CreateTransitGatewayVpcAttachment
In this article:
CreateTransitGatewayVpcAttachment#
Description#
Request to attach a VPC to a transit gateway. To forward VPC traffic to the attached transit gateway, add the route to the VPC’s route table.
Note
Subnets that are attached to a transit gateway should have non-overlapping CIDRs. All attachments to a transit gateway should be in the same availability zones.
Request Parameters#
Required parameters#
SubnetIds.N — The subnet IDs.
Type: Array of strings
Required: Yes
Constraints: For each availability zone, only one subnet can be specified
TransitGatewayId — The ID of the transit gateway.
Type: String
Required: Yes
VpcId — The ID of the VPC.
Type: String
Required: Yes
Optional parameters#
TagSpecifications.N — Tags assigned to the transit gateway attachment to VPC, being created.
Type: List of TagSpecification objects
Required: No
Response Elements#
requestId — The request ID.
Type: String
transitGatewayVpcAttachment — Information about VPC attachment to the transit gateway.
Type: TransitGatewayVpcAttachment object
Examples#
c2-ec2 CreateTransitGatewayVpcAttachment TransitGatewayId tgw-12345678 VpcId vpc-12345678 SubnetIds.0 subnet-12345678