How do you build cross-account networking such as Transit Gateway attachments with Terraform?
AdvancedProductionRepository Structure, Environments and Module Strategy
Answer
Use two provider configurations (hub and spoke accounts) passed into a module via providers. The spoke creates the attachment request, the hub accepts it (aws_ec2_transit_gateway_vpc_attachment_accepter) and adds routes. Keep RAM sharing of the TGW and cross-account IAM in the foundation stack, and apply in the right order since the hub change depends on the spoke's attachment ID.
More on Repository Structure, Environments and Module Strategy
Monorepo or multi-repo for Terraform?BeginnerHow do you lay out environments in a repo?BeginnerWhen would you adopt Terragrunt?BeginnerDo you use tfvars files per environment or code branches?IntermediateHow do you promote a module change from dev to qa to prod?AdvancedWhat is an internal module registry strategy?Beginner