-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
feat!: Refactor count
/lists
into for_each
/maps
#113
base: master
Are you sure you want to change the base?
feat!: Refactor count
/lists
into for_each
/maps
#113
Conversation
To avoid downtime when adding/removing attachments. With the previous approach, any new or removed attachments would cause the attachment routes to be deleted and re-created according to the new order.
And unifying peering/VPC attachments under one parameter, VPC attachments are filtered out of the parameter to create the VPC attachement resources.
For fetching attachment details. Add VPC attachment accepter resource to avoid the need for "auto-accept shared attachments" when sharing via RAM.
When route destinations are defined
With composite keys to allow associating/propagating custom route tables.
This PR has been automatically marked as stale because it has been open 30 days |
count
/lists
into for_each
/maps
@bryantbiggs anything I can help with to move this along? |
@@ -162,9 +270,9 @@ resource "aws_ram_resource_association" "this" { | |||
} | |||
|
|||
resource "aws_ram_principal_association" "this" { | |||
count = var.create_tgw && var.share_tgw ? length(var.ram_principals) : 0 | |||
for_each = var.create_tgw && var.share_tgw ? var.ram_principals : [] |
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.
for_each = var.create_tgw && var.share_tgw ? var.ram_principals : [] | |
for_each = var.create_tgw && var.share_tgw ? var.ram_principals : toset([]) |
The right side should be a set
...
Even fixing it, we will face the for_each
problem for computed values as mentioned here by @bryantbiggs
However, the current version of this module is using count
which will produce the same error for computed values 🤔
Could we have a separate PR for adding flow logs? They're quite useful, and it's a shame they're "stuck" in this PR. |
Description
Motivation and Context
This module was missing quite a few features that are necessary for true multi-account operation, as well as operational concerns like logging.
Breaking Changes
This PR includes breaking changes due to changes in data structures. The changes to data structures (converting lists/sets to maps, mostly) were necessary to prevent downtime during applies due to deleting/re-creating routes.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull requestI am running my refactor in production currently, using one AWS account as the hub, and several other AWS accounts as the spokes.