Skip to content
v2.277.0

CfnRouteProps Struct ​

Properties for defining a CfnRoute.

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 cfnRouteProps: ec2.CfnRouteProps = {
  routeTableId: 'routeTableId',

  // the properties below are optional
  carrierGatewayId: 'carrierGatewayId',
  coreNetworkArn: 'coreNetworkArn',
  destinationCidrBlock: 'destinationCidrBlock',
  destinationIpv6CidrBlock: 'destinationIpv6CidrBlock',
  destinationPrefixListId: 'destinationPrefixListId',
  egressOnlyInternetGatewayId: 'egressOnlyInternetGatewayId',
  gatewayId: 'gatewayId',
  instanceId: 'instanceId',
  localGatewayId: 'localGatewayId',
  natGatewayId: 'natGatewayId',
  networkInterfaceId: 'networkInterfaceId',
  odbNetworkArn: 'odbNetworkArn',
  transitGatewayId: 'transitGatewayId',
  vpcEndpointId: 'vpcEndpointId',
  vpcPeeringConnectionId: 'vpcPeeringConnectionId',
};
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_route_props = ec2.CfnRouteProps(
    route_table_id="routeTableId",

    # the properties below are optional
    carrier_gateway_id="carrierGatewayId",
    core_network_arn="coreNetworkArn",
    destination_cidr_block="destinationCidrBlock",
    destination_ipv6_cidr_block="destinationIpv6CidrBlock",
    destination_prefix_list_id="destinationPrefixListId",
    egress_only_internet_gateway_id="egressOnlyInternetGatewayId",
    gateway_id="gatewayId",
    instance_id="instanceId",
    local_gateway_id="localGatewayId",
    nat_gateway_id="natGatewayId",
    network_interface_id="networkInterfaceId",
    odb_network_arn="odbNetworkArn",
    transit_gateway_id="transitGatewayId",
    vpc_endpoint_id="vpcEndpointId",
    vpc_peering_connection_id="vpcPeeringConnectionId"
)
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.*;

CfnRouteProps cfnRouteProps = CfnRouteProps.builder()
        .routeTableId("routeTableId")

        // the properties below are optional
        .carrierGatewayId("carrierGatewayId")
        .coreNetworkArn("coreNetworkArn")
        .destinationCidrBlock("destinationCidrBlock")
        .destinationIpv6CidrBlock("destinationIpv6CidrBlock")
        .destinationPrefixListId("destinationPrefixListId")
        .egressOnlyInternetGatewayId("egressOnlyInternetGatewayId")
        .gatewayId("gatewayId")
        .instanceId("instanceId")
        .localGatewayId("localGatewayId")
        .natGatewayId("natGatewayId")
        .networkInterfaceId("networkInterfaceId")
        .odbNetworkArn("odbNetworkArn")
        .transitGatewayId("transitGatewayId")
        .vpcEndpointId("vpcEndpointId")
        .vpcPeeringConnectionId("vpcPeeringConnectionId")
        .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 cfnRouteProps = new CfnRouteProps {
    RouteTableId = "routeTableId",

    // the properties below are optional
    CarrierGatewayId = "carrierGatewayId",
    CoreNetworkArn = "coreNetworkArn",
    DestinationCidrBlock = "destinationCidrBlock",
    DestinationIpv6CidrBlock = "destinationIpv6CidrBlock",
    DestinationPrefixListId = "destinationPrefixListId",
    EgressOnlyInternetGatewayId = "egressOnlyInternetGatewayId",
    GatewayId = "gatewayId",
    InstanceId = "instanceId",
    LocalGatewayId = "localGatewayId",
    NatGatewayId = "natGatewayId",
    NetworkInterfaceId = "networkInterfaceId",
    OdbNetworkArn = "odbNetworkArn",
    TransitGatewayId = "transitGatewayId",
    VpcEndpointId = "vpcEndpointId",
    VpcPeeringConnectionId = "vpcPeeringConnectionId"
};
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"

cfnRouteProps := &CfnRouteProps{
	RouteTableId: jsii.String("routeTableId"),

	// the properties below are optional
	CarrierGatewayId: jsii.String("carrierGatewayId"),
	CoreNetworkArn: jsii.String("coreNetworkArn"),
	DestinationCidrBlock: jsii.String("destinationCidrBlock"),
	DestinationIpv6CidrBlock: jsii.String("destinationIpv6CidrBlock"),
	DestinationPrefixListId: jsii.String("destinationPrefixListId"),
	EgressOnlyInternetGatewayId: jsii.String("egressOnlyInternetGatewayId"),
	GatewayId: jsii.String("gatewayId"),
	InstanceId: jsii.String("instanceId"),
	LocalGatewayId: jsii.String("localGatewayId"),
	NatGatewayId: jsii.String("natGatewayId"),
	NetworkInterfaceId: jsii.String("networkInterfaceId"),
	OdbNetworkArn: jsii.String("odbNetworkArn"),
	TransitGatewayId: jsii.String("transitGatewayId"),
	VpcEndpointId: jsii.String("vpcEndpointId"),
	VpcPeeringConnectionId: jsii.String("vpcPeeringConnectionId"),
}

Properties ​

carrierGatewayIdoptionalstring | ICarrierGatewayRefcarrier_gateway_idoptionaltyping.Union[str, ICarrierGatewayRef]carrierGatewayIdoptionalStringCarrierGatewayIdoptionalstringCarrierGatewayIdoptionalinterface{}#
The ID of the carrier gateway.

You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.

coreNetworkArnoptionalstringcore_network_arnoptionalstrcoreNetworkArnoptionalStringCoreNetworkArnoptionalstringCoreNetworkArnoptional*string#
The Amazon Resource Name (ARN) of the core network.
destinationCidrBlockoptionalstringdestination_cidr_blockoptionalstrdestinationCidrBlockoptionalStringDestinationCidrBlockoptionalstringDestinationCidrBlockoptional*string#
The IPv4 CIDR address block used for the destination match.

Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18 , we modify it to 100.68.0.0/18 .

destinationIpv6CidrBlockoptionalstringdestination_ipv6_cidr_blockoptionalstrdestinationIpv6CidrBlockoptionalStringDestinationIpv6CidrBlockoptionalstringDestinationIpv6CidrBlockoptional*string#
The IPv6 CIDR block used for the destination match.

Routing decisions are based on the most specific match.

destinationPrefixListIdoptionalstringdestination_prefix_list_idoptionalstrdestinationPrefixListIdoptionalStringDestinationPrefixListIdoptionalstringDestinationPrefixListIdoptional*string#
The ID of a prefix list used for the destination match.
egressOnlyInternetGatewayIdoptionalstring | IEgressOnlyInternetGatewayRefegress_only_internet_gateway_idoptionaltyping.Union[str, IEgressOnlyInternetGatewayRef]egressOnlyInternetGatewayIdoptionalStringEgressOnlyInternetGatewayIdoptionalstringEgressOnlyInternetGatewayIdoptionalinterface{}#
[IPv6 traffic only] The ID of an egress-only internet gateway.
gatewayIdoptionalstring | IInternetGatewayRef | IVPNGatewayRefgateway_idoptionaltyping.Union[str, IInternetGatewayRef, IVPNGatewayRef]gatewayIdoptionalStringGatewayIdoptionalstringGatewayIdoptionalinterface{}#
The ID of an internet gateway or virtual private gateway attached to your VPC.
instanceIdoptionalstring | IInstanceRefinstance_idoptionaltyping.Union[str, IInstanceRef]instanceIdoptionalStringInstanceIdoptionalstringInstanceIdoptionalinterface{}#
The ID of a NAT instance in your VPC.

The operation fails if you specify an instance ID unless exactly one network interface is attached.

localGatewayIdoptionalstringlocal_gateway_idoptionalstrlocalGatewayIdoptionalStringLocalGatewayIdoptionalstringLocalGatewayIdoptional*string#
The ID of the local gateway.
natGatewayIdoptionalstring | INatGatewayRefnat_gateway_idoptionaltyping.Union[str, INatGatewayRef]natGatewayIdoptionalStringNatGatewayIdoptionalstringNatGatewayIdoptionalinterface{}#
[IPv4 traffic only] The ID of a NAT gateway.
networkInterfaceIdoptionalstringnetwork_interface_idoptionalstrnetworkInterfaceIdoptionalStringNetworkInterfaceIdoptionalstringNetworkInterfaceIdoptional*string#
The ID of a network interface.
odbNetworkArnoptionalstringodb_network_arnoptionalstrodbNetworkArnoptionalStringOdbNetworkArnoptionalstringOdbNetworkArnoptional*string#
The Amazon Resource Name (ARN) of the ODB network.
routeTableIdstring | IRouteTableRefroute_table_idtyping.Union[str, IRouteTableRef]routeTableIdStringRouteTableIdstringRouteTableIdinterface{}required#
The ID of the route table for the route.
transitGatewayIdoptionalstring | ITransitGatewayReftransit_gateway_idoptionaltyping.Union[str, ITransitGatewayRef]transitGatewayIdoptionalStringTransitGatewayIdoptionalstringTransitGatewayIdoptionalinterface{}#
The ID of a transit gateway.
vpcEndpointIdoptionalstringvpc_endpoint_idoptionalstrvpcEndpointIdoptionalStringVpcEndpointIdoptionalstringVpcEndpointIdoptional*string#
The ID of a VPC endpoint.

Supported for Gateway Load Balancer endpoints only.

vpcPeeringConnectionIdoptionalstring | IVPCPeeringConnectionRefvpc_peering_connection_idoptionaltyping.Union[str, IVPCPeeringConnectionRef]vpcPeeringConnectionIdoptionalStringVpcPeeringConnectionIdoptionalstringVpcPeeringConnectionIdoptionalinterface{}#
The ID of a VPC peering connection.