When run, the python code linked below runs into an issue addressed in terraform!30838
[2024-05-19T14:13:19.104] [ERROR] default - ╷
│ Error: Invalid for_each argument
│
│ on cdk.tf.json line 180, in resource.aws_route53_record.redacted:
│ 180: "for_each": "${{ for key, val in tolist(aws_acm_certificate.redacted_B0655DA5.domain_validation_options): val.domain_name => val }}",
│ ├────────────────
│ │ aws_acm_certificate.redacted_B0655DA5.domain_validation_options is set of object with 2 elements
│
│ The "for_each" map includes keys derived from resource attributes that
│ cannot be determined until apply, and so Terraform cannot determine the
│ full set of keys that will identify the instances of this resource.
│
│ When working with unknown values in for_each, it's better to define the map
│ keys statically in your configuration and place apply-time results only in
│ the map values.
│
│ Alternatively, you could use the -target planning option to first apply
│ only the resources that the for_each value depends on, and then apply a
│ second time to fully converge
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
When run, the python code linked below runs into an issue addressed in terraform!30838
This is compounded by terraform-provider-aws!33613 also having invalid example code.
Links
Help Wanted
Community Note