AWS CloudFormation
User Guide (API Version 2010-05-15)


Creates an attachment between a VPC and a transit gateway. For more information, see Amazon VPC Transit Gateways.


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 values

Update requires: Replacement


The tags to apply to the VPC attachment.

Required: No

Type: List of Resource Tag property types

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 an AWS::EC2::TransitGatewayAttachment resource to the intrinsic Ref function, the function returns the ID of the attachment, such as tgw-attach-vpc-0d39e0d39e0d39e.

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

See Also