This example creates a Transit Gateway connecting two VPCs using default route tables for full mesh connectivity.
+--------+ +------------------+ +--------+
| VPC A |--------->| Transit Gateway |<---------| VPC B |
| 10.1.0 | | (Default RT) | | 10.2.0 |
+--------+ +------------------+ +--------+
Both VPCs are attached to the Transit Gateway and use the default route table, enabling bidirectional communication.
terraform init
terraform plan
terraform apply- 1 Transit Gateway
- 2 VPC Attachments (one per VPC)
- 2 VPCs with private subnets (supporting resources)
- Transit Gateway: ~$36/month (per attachment hour)
- VPC Attachments: ~$0.05/hour per attachment
- Data processing: $0.02/GB
See AWS Transit Gateway Pricing for current rates.