AWS::EC2::TransitGatewayAttachmentAttaches 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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-route.html) . To update tags for a VPC attachment after creation without replacing the attachment, use [AWS::EC2::TransitGatewayVpcAttachment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayvpcattachment.html) instead.
import { CfnTransitGatewayAttachment } from 'aws-cdk-lib/aws-ec2';Or use the module namespace:
import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnTransitGatewayAttachmentConfiguration passed to the constructor as CfnTransitGatewayAttachmentProps.
subnetIdsRequiredstring | ISubnetRef[]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.
transitGatewayIdRequiredstring | ITransitGatewayRefThe ID of the transit gateway.
vpcIdRequiredstring | IVPCRefThe ID of the VPC.
optionsOptionalanyThe VPC attachment options.
tagsOptionalCfnTag[]The tags for the attachment.
This L1 construct maps directly to the following CloudFormation resource type.
Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.
Download Free Infographicaws-ec2AWS::EC2::TransitGatewayAttachment