Skip to content
v2.278.0

CfnTransitGatewayRouteProps Struct ​

Properties for defining a CfnTransitGatewayRoute.

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';
const cfnTransitGatewayRouteProps: ec2.CfnTransitGatewayRouteProps = {
  destinationCidrBlock: 'destinationCidrBlock',
  transitGatewayRouteTableId: 'transitGatewayRouteTableId',

  // the properties below are optional
  blackhole: false,
  transitGatewayAttachmentId: 'transitGatewayAttachmentId',
};
python
# 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

cfn_transit_gateway_route_props = ec2.CfnTransitGatewayRouteProps(
    destination_cidr_block="destinationCidrBlock",
    transit_gateway_route_table_id="transitGatewayRouteTableId",

    # the properties below are optional
    blackhole=False,
    transit_gateway_attachment_id="transitGatewayAttachmentId"
)
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.*;

CfnTransitGatewayRouteProps cfnTransitGatewayRouteProps = CfnTransitGatewayRouteProps.builder()
        .destinationCidrBlock("destinationCidrBlock")
        .transitGatewayRouteTableId("transitGatewayRouteTableId")

        // the properties below are optional
        .blackhole(false)
        .transitGatewayAttachmentId("transitGatewayAttachmentId")
        .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 cfnTransitGatewayRouteProps = new CfnTransitGatewayRouteProps {
    DestinationCidrBlock = "destinationCidrBlock",
    TransitGatewayRouteTableId = "transitGatewayRouteTableId",

    // the properties below are optional
    Blackhole = false,
    TransitGatewayAttachmentId = "transitGatewayAttachmentId"
};
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"

cfnTransitGatewayRouteProps := &CfnTransitGatewayRouteProps{
	DestinationCidrBlock: jsii.String("destinationCidrBlock"),
	TransitGatewayRouteTableId: jsii.String("transitGatewayRouteTableId"),

	// the properties below are optional
	Blackhole: jsii.Boolean(false),
	TransitGatewayAttachmentId: jsii.String("transitGatewayAttachmentId"),
}

Properties ​

blackholeoptionalboolean | IResolvableblackholeoptionaltyping.Union[bool, IResolvable]blackholeoptionalBooleanBlackholeoptionalboolBlackholeoptionalinterface{} #
Indicates whether to drop traffic that matches this route.
destinationCidrBlockstringdestination_cidr_blockstrdestinationCidrBlockStringDestinationCidrBlockstringDestinationCidrBlock*string required #
The CIDR block used for destination matches.
transitGatewayAttachmentIdoptionalstring | ITransitGatewayAttachmentRef | ITransitGatewayPeeringAttachmentReftransit_gateway_attachment_idoptionaltyping.Union[str, ITransitGatewayAttachmentRef, ITransitGatewayPeeringAttachmentRef]transitGatewayAttachmentIdoptionalStringTransitGatewayAttachmentIdoptionalstringTransitGatewayAttachmentIdoptionalinterface{} #
The ID of the attachment.
transitGatewayRouteTableIdstring | ITransitGatewayRouteTableReftransit_gateway_route_table_idtyping.Union[str, ITransitGatewayRouteTableRef]transitGatewayRouteTableIdStringTransitGatewayRouteTableIdstringTransitGatewayRouteTableIdinterface{} required #
The ID of the transit gateway route table.