Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPONENT: example for iterators on complex lists #3627

Open
1 task
infowolfe opened this issue May 19, 2024 · 0 comments
Open
1 task

COMPONENT: example for iterators on complex lists #3627

infowolfe opened this issue May 19, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation new Un-triaged issue

Comments

@infowolfe
Copy link

Description

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

This is compounded by terraform-provider-aws!33613 also having invalid example code.

Links

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • 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
@infowolfe infowolfe added documentation Improvements or additions to documentation new Un-triaged issue labels May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant