AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EC2::TransitGatewayAttachment

CfnTransitGatewayAttachment

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](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

import { CfnTransitGatewayAttachment } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnTransitGatewayAttachment

Properties

Configuration passed to the constructor as CfnTransitGatewayAttachmentProps.

subnetIdsRequired
string | 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.

transitGatewayIdRequired
string | ITransitGatewayRef

The ID of the transit gateway.

vpcIdRequired
string | IVPCRef

The ID of the VPC.

optionsOptional
any

The VPC attachment options.

tagsOptional
CfnTag[]

The tags for the attachment.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic