Skip to content
v2.278.0

Experimental

@aws-cdk/aws-ec2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

TransitGatewayVpcAttachmentProps Struct ​

Common properties for creating a Transit Gateway VPC Attachment resource.

Example ​

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

declare const subnet: ec2.Subnet;
declare const transitGateway: ec2_alpha.TransitGateway;
declare const transitGatewayVpcAttachmentOptions: ec2_alpha.ITransitGatewayVpcAttachmentOptions;
declare const vpc: ec2.Vpc;
const transitGatewayVpcAttachmentProps: ec2_alpha.TransitGatewayVpcAttachmentProps = {
  subnets: [subnet],
  transitGateway: transitGateway,
  vpc: vpc,

  // the properties below are optional
  transitGatewayAttachmentName: 'transitGatewayAttachmentName',
  vpcAttachmentOptions: transitGatewayVpcAttachmentOptions,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2_alpha as ec2_alpha
from aws_cdk import aws_ec2 as ec2

# subnet: ec2.Subnet
# transit_gateway: ec2_alpha.TransitGateway
# transit_gateway_vpc_attachment_options: ec2_alpha.ITransitGatewayVpcAttachmentOptions
# vpc: ec2.Vpc

transit_gateway_vpc_attachment_props = ec2_alpha.TransitGatewayVpcAttachmentProps(
    subnets=[subnet],
    transit_gateway=transit_gateway,
    vpc=vpc,

    # the properties below are optional
    transit_gateway_attachment_name="transitGatewayAttachmentName",
    vpc_attachment_options=transit_gateway_vpc_attachment_options
)
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.alpha.*;
import software.amazon.awscdk.services.ec2.*;

Subnet subnet;
TransitGateway transitGateway;
ITransitGatewayVpcAttachmentOptions transitGatewayVpcAttachmentOptions;
Vpc vpc;

TransitGatewayVpcAttachmentProps transitGatewayVpcAttachmentProps = TransitGatewayVpcAttachmentProps.builder()
        .subnets(List.of(subnet))
        .transitGateway(transitGateway)
        .vpc(vpc)

        // the properties below are optional
        .transitGatewayAttachmentName("transitGatewayAttachmentName")
        .vpcAttachmentOptions(transitGatewayVpcAttachmentOptions)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.ec2.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ec2.Alpha;
using Amazon.CDK.AWS.EC2;

Subnet subnet;
TransitGateway transitGateway;
ITransitGatewayVpcAttachmentOptions transitGatewayVpcAttachmentOptions;
Vpc vpc;

var transitGatewayVpcAttachmentProps = new TransitGatewayVpcAttachmentProps {
    Subnets = new [] { subnet },
    TransitGateway = transitGateway,
    Vpc = vpc,

    // the properties below are optional
    TransitGatewayAttachmentName = "transitGatewayAttachmentName",
    VpcAttachmentOptions = transitGatewayVpcAttachmentOptions
};
go
// Install: go get github.com/aws/aws-cdk-go/awsec2alpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import ec2_alpha "github.com/aws/aws-cdk-go/awsec2alpha"
import "github.com/aws/aws-cdk-go/awscdk"

var subnet Subnet
var transitGateway TransitGateway
var transitGatewayVpcAttachmentOptions ITransitGatewayVpcAttachmentOptions
var vpc Vpc

transitGatewayVpcAttachmentProps := &TransitGatewayVpcAttachmentProps{
	Subnets: []ISubnet{
		subnet,
	},
	TransitGateway: transitGateway,
	Vpc: vpc,

	// the properties below are optional
	TransitGatewayAttachmentName: jsii.String("transitGatewayAttachmentName"),
	VpcAttachmentOptions: transitGatewayVpcAttachmentOptions,
}

Properties ​

subnetsISubnet[]subnetstyping.List[ISubnet]subnetsList<ISubnet>SubnetsISubnet[]Subnets*[]ISubnet required #
A list of one or more subnets to place the attachment in.

It is recommended to specify more subnets for better availability.

transitGatewayITransitGatewaytransit_gatewayITransitGatewaytransitGatewayITransitGatewayTransitGatewayITransitGatewayTransitGatewayITransitGateway required #
The transit gateway this attachment gets assigned to.
transitGatewayAttachmentNameoptionalstringtransit_gateway_attachment_nameoptionalstrtransitGatewayAttachmentNameoptionalStringTransitGatewayAttachmentNameoptionalstringTransitGatewayAttachmentNameoptional*string #
Physical name of this Transit Gateway VPC Attachment.

Default: Assigned by CloudFormation.

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc required #
A VPC attachment(s) will get assigned to.
vpcAttachmentOptionsoptionalITransitGatewayVpcAttachmentOptionsvpc_attachment_optionsoptionalITransitGatewayVpcAttachmentOptionsvpcAttachmentOptionsoptionalITransitGatewayVpcAttachmentOptionsVpcAttachmentOptionsoptionalITransitGatewayVpcAttachmentOptionsVpcAttachmentOptionsoptionalITransitGatewayVpcAttachmentOptions #
The VPC attachment options.

Default: All options are disabled.