I have created a transit gateway using the terraform tgw module as shown below.
module "transit-gateway" {
source = "terraform-aws-modules/transit-gateway/aws"
version = "1.4.0"
name = "tgw-nprod"
description = "My TGW shared with several other AWS accounts"
amazon_side_asn = 64532
enable_auto_accept_shared_attachments = true
vpc_attachments = {
vpc1 = {
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
dns_support = true
ipv6_support = false
transit_gateway_default_route_table_association = false
transit_gateway_default_route_table_propagation = false
}
}
ram_allow_external_principals = true
ram_principals = [1234567890, 0987654321]
tags = {
Purpose = "tgw-testing"
}
}
I have created vpc using the terraform vpc module.
When I run the above terraform Iam getting error "Error: error creating EC2 Transit Gateway VPC Attachment: DuplicateSubnetsInSameZone: Duplicate Subnets for same AZ"
I have 2 private subnet in ap-south-1 and 1 public in ap-south-1.