cloudposse / terraform-aws-transit-gateway

Terraform module to provision AWS Transit Gateway, AWS Resource Access Manager (AWS RAM) Resource, and share the Transit Gateway with the Organization or another AWS Account.
https://cloudposse.com/accelerate
Apache License 2.0
54 stars 49 forks source link

Support multiple RAM principals #19

Closed alexjurkiewicz closed 2 years ago

alexjurkiewicz commented 2 years ago

Introduce new variable var.ram_principals, and deprecate var.ram_principal. Deprecating rather than removing the old variable is a lot more complex, code-wise, but the complexity is contained and should ease the upgrade path for existing customers.

Fixes #14

alexjurkiewicz commented 2 years ago

Thanks for the early review. I found a few other bugs and I'm testing internally. I will convert this PR to draft so you don't waste time 🙏

alexjurkiewicz commented 2 years ago

Looks like it's working to me! I can specify two external AWS account IDs and two aws_ram_principal_association are created.

aknysh commented 2 years ago

/test all

aknysh commented 2 years ago

@alexjurkiewicz thanks again

please see the terratest error

Error: Invalid for_each argument
TestExamplesComplete 2022-03-15T15:12:53Z logger.go:66: 
TestExamplesComplete 2022-03-15T15:12:53Z logger.go:66:   on ../../ram.tf line 34, in resource "aws_ram_principal_association" "default":
TestExamplesComplete 2022-03-15T15:12:53Z logger.go:66:   34:   for_each           = local.ram_principals
TestExamplesComplete 2022-03-15T15:12:53Z logger.go:66: 
TestExamplesComplete 2022-03-15T15:12:53Z logger.go:66: The given "for_each" argument value is unsuitable: the "for_each" argument
TestExamplesComplete 2022-03-15T15:12:53Z logger.go:66: must be a map, or set of strings, and you have provided a value of type tuple.
alexjurkiewicz commented 2 years ago

I've updated the PR

Gowiem commented 2 years ago

/test all

aknysh commented 2 years ago

/test all

aknysh commented 2 years ago

/test all

alexjurkiewicz commented 2 years ago

thank you for all the help Andriy 😊