fix: Correct for_each map on VPC endpoints to propagate endpoint maps correctly#729
Merged
antonbabenko merged 1 commit intoterraform-aws-modules:masterfrom Jan 11, 2022
Conversation
for_each map on VPC endpoints to propagate endpoint maps correctlyfor_each map on VPC endpoints to propagate endpoint maps correctly
antonbabenko
approved these changes
Jan 11, 2022
| 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), []) |
Member
There was a problem hiding this comment.
try() ❤️
Much more elegant!
Member
|
Let me know if/when this one is ready for merge. |
Member
Author
|
@antonbabenko - should be all set, already checked with the |
antonbabenko
pushed a commit
that referenced
this pull request
Jan 11, 2022
### [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))
Member
|
This PR is included in version 3.11.2 🎉 |
harrythebot
pushed a commit
to lolocompany/terraform-aws-vpc
that referenced
this pull request
May 11, 2022
harrythebot
pushed a commit
to lolocompany/terraform-aws-vpc
that referenced
this pull request
May 11, 2022
### [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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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