Skip to content
v2.278.0

CfnTransitGatewayAttachmentProps ​

Struct External

Properties for defining a CfnTransitGatewayAttachment.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const options: any;
const cfnTransitGatewayAttachmentProps: ec2.CfnTransitGatewayAttachmentProps = {
  subnetIds: ['subnetIds'],
  transitGatewayId: 'transitGatewayId',
  vpcId: 'vpcId',

  // the properties below are optional
  options: options,
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

# options: Any

cfn_transit_gateway_attachment_props = ec2.CfnTransitGatewayAttachmentProps(
    subnet_ids=["subnetIds"],
    transit_gateway_id="transitGatewayId",
    vpc_id="vpcId",

    # the properties below are optional
    options=options,
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

Object options;

CfnTransitGatewayAttachmentProps cfnTransitGatewayAttachmentProps = CfnTransitGatewayAttachmentProps.builder()
        .subnetIds(List.of("subnetIds"))
        .transitGatewayId("transitGatewayId")
        .vpcId("vpcId")

        // the properties below are optional
        .options(options)
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var options;

var cfnTransitGatewayAttachmentProps = new CfnTransitGatewayAttachmentProps {
    SubnetIds = new [] { "subnetIds" },
    TransitGatewayId = "transitGatewayId",
    VpcId = "vpcId",

    // the properties below are optional
    Options = options,
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var options interface{}

cfnTransitGatewayAttachmentProps := &CfnTransitGatewayAttachmentProps{
	SubnetIds: []interface{}{
		jsii.String("subnetIds"),
	},
	TransitGatewayId: jsii.String("transitGatewayId"),
	VpcId: jsii.String("vpcId"),

	// the properties below are optional
	Options: options,
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

optionsoptionalanyoptionsoptionalAnyoptionsoptionalObjectOptionsoptionalobjectOptionsoptionalinterface{} #
The VPC attachment options.
subnetIdsstring | ISubnetRef[]subnet_idstyping.List[typing.Union[str, ISubnetRef]]subnetIdsList<String>SubnetIdsstring[]SubnetIds*[]interface{} required #
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.

tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
The tags for the attachment.
transitGatewayIdstring | ITransitGatewayReftransit_gateway_idtyping.Union[str, ITransitGatewayRef]transitGatewayIdStringTransitGatewayIdstringTransitGatewayIdinterface{} required #
The ID of the transit gateway.
vpcIdstring | IVPCRefvpc_idtyping.Union[str, IVPCRef]vpcIdStringVpcIdstringVpcIdinterface{} required #
The ID of the VPC.