gravicore / terraform-gravicore-modules

This is a collection of reusable Terraform modules for Gravicore's cloud automation platform.
https://gravicore.io
Apache License 2.0
8 stars 8 forks source link

GDEV-94 ⁃ Fix `Invalid for_each argument` bug in SSM Parameters module #196

Closed sync-by-unito[bot] closed 3 years ago

sync-by-unito[bot] commented 3 years ago
Error: Invalid for_each argument
  on .terraform/modules/parameters_key_pair/aws/parameters/write.tf line 40, in resource "aws_ssm_parameter" "write_parameters":
  40:   for_each    = var.create ? { for k, v in var.write_parameters : k => v if v.value != "" } : {}
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: GDEV-94