-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: Correct for_each map on VPC endpoints to propagate endpoint maps correctly
#729
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
fix: Correct for_each map on VPC endpoints to propagate endpoint maps correctly
#729
Conversation
for_each map on VPC endpoints to propagate endpoint maps correctlyfor_each map on VPC endpoints to propagate endpoint maps correctly
| output "redshift_route_table_ids" { | ||
| description = "List of IDs of redshift route tables" | ||
| value = length(aws_route_table.redshift.*.id) > 0 ? aws_route_table.redshift.*.id : (var.enable_public_redshift ? aws_route_table.public.*.id : aws_route_table.private.*.id) | ||
| value = try(coalescelist(aws_route_table.redshift[*].id, aws_route_table.public[*].id, aws_route_table.private[*].id), []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try() ❤️
Much more elegant!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elegant but wrong :)
Bug #738
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah shoot, my bad
|
Let me know if/when this one is ready for merge. |
|
@antonbabenko - should be all set, already checked with the |
### [3.11.2](v3.11.1...v3.11.2) (2022-01-11) ### Bug Fixes * Correct `for_each` map on VPC endpoints to propagate endpoint maps correctly ([#729](#729)) ([19fcf0d](19fcf0d))
|
This PR is included in version 3.11.2 🎉 |
### [3.11.2](terraform-aws-modules/terraform-aws-vpc@v3.11.1...v3.11.2) (2022-01-11) ### Bug Fixes * Correct `for_each` map on VPC endpoints to propagate endpoint maps correctly ([terraform-aws-modules#729](terraform-aws-modules#729)) ([19fcf0d](terraform-aws-modules@19fcf0d))
|
I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
for_eachmap on VPC endpoints to propagate endpoint maps correctly by using the map comprehension. this also solves for the case wherecreate = falseand avoiding theError: Inconsistent conditional result types. The true result value has the wrong type: element types must all match for conversion to map.errorcomplete-vpcexample to demonstrate/validate use case with security group issue shown in VPC endpoints module fails if a dynamodb block is added #650try()and recommended index[0]/[*]syntaxMotivation and Context
Breaking Changes
How Has This Been Tested?
examples/*projects- Validated with
complete-vpcexample; no plan diff from currentmaster