我使用 terraform tgw 模块创建了一个中转网关,如下所示。
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"
}
}
我使用 terraform vpc 模块创建了 vpc。
当我运行上述 terraform 时,我收到错误“错误:创建 EC2 Transit Gateway VPC 附件时出错:DuplicateSubnetsInSameZone: Duplicate Subnets for same AZ ”
我在 ap-south-1 中有 2 个私有子网,在 ap-south-1 中有 1 个公共子网。