AWS::EC2::TransitGatewayAttachment - AWS CloudFormation


Attaches a VPC to a transit gateway.

If you attach a VPC with a CIDR range that overlaps the CIDR range of a VPC that is already attached, the new VPC CIDR range is not propagated to the default propagation route table.

To send VPC traffic to an attached transit gateway, add a route to the VPC route table using AWS::EC2::Route.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::EC2::TransitGatewayAttachment", "Properties" : { "SubnetIds" : [ String, ... ], "Tags" : [ Tag, ... ], "TransitGatewayId" : String, "VpcId" : String } }


Type: AWS::EC2::TransitGatewayAttachment Properties: SubnetIds: - String Tags: - Tag TransitGatewayId: String VpcId: String



The IDs of one or more subnets. You can specify only one subnet per Availability Zone. You must specify at least one subnet, but we recommend that you specify two subnets for better availability. The transit gateway uses one IP address from each specified subnet.

Required: Yes

Type: List of String

Update requires: Replacement


The tags for the attachment.

Required: No

Type: List of Tag

Update requires: Replacement


The ID of the transit gateway.

Required: Yes

Type: String

Update requires: Replacement


The ID of the VPC.

Required: Yes

Type: String

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the attachment.

For more information about using the Ref function, see Ref.

See also