-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
for_each errors out for list of maps #22610
Comments
for_each requires a map or just a list of strings, try this:
|
To reinforce @rrijkse's (already correct, thanks!) answer: https://www.terraform.io/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings Please note that we use GitHub issues for tracking bugs and enhancements rather than for questions. While we may be able to help with certain simple problems here it's generally better to use the community forum where there are far more people ready to help, whereas the GitHub issues here are generally monitored only by our few core maintainers. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I could not find a specific thread in the Github issue or in the Hashicorp community forum that mentions this issue with
for_each
and lists of maps. Let me know if this is a possible duplicate.Terraform Version
Terraform Configuration Files
Expected Behavior
Create the resources in a
for_each
loop with theeach.value
being the map object of the item. In this case creating Github Team memnerships.Actual Behavior
When running
terraform plan
, I am immediately given the errorSteps to Reproduce
Run plan the terraform code above
The text was updated successfully, but these errors were encountered: