Open ryanmckeague opened 4 years ago
If I understand what you're attempting to do(create two transit gateway attachments on a single VPC to the same transit gateway), that's not supported in AWS. While a VPC can have up to 5 transit gateway attachments, you can only have one attachment between the same VPC and transit gateway pair.
An error occurred (DuplicateTransitGatewayAttachment) when calling the CreateTransitGatewayVpcAttachment operation: tgw-08ab8b4becc0f50e4 has non-deleted Transit Gateway Attachments with same VPC ID. Please looking where the issue is going from.
When you attach a VPC to a transit gateway, you must specify one subnet from each Availability Zone to be used by the transit gateway to route traffic. Specifying one subnet from an Availability Zone enables traffic to reach resources in every subnet in that Availability Zone.
https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html
There is a same issue in my terraform code, the terraform try to create a new TGW gateway attachment which already exists in our AWS account. We try to import the duplicated attachment, then terraform try to delete and recreate the attachment.
I have try to manually changed the attributes of existing attachment to match it. They are exactly the same
The aws provider version is 3.73.0.
Any thoughts?
Community Note
Terraform Version
0.11.11
Affected Resource(s)
aws_ec2_transit_gateway_vpc_attachment
Terraform Configuration Files
VPC module in use: https://github.com/terraform-aws-modules/terraform-aws-vpc
Debug Output
Panic Output
Expected Behavior
2x Transit Gateway attachments should have been made. 1x to each subnet ID (each in a different AZ) defined in intra_subnets.
Actual Behavior
Error due to VPC ID being the same for each Transit Gateway attachment. VPC ID should be the same as the attachments are being made to 2x separate AZs within the same VPC.
Steps to Reproduce
terraform apply
Important Factoids
Running TF v0.11.11 as that is a requirement for the version running in TFE that will be deployed to.
References
0000