CfnRoutePropsMixin

class aws_cdk.cfn_property_mixins.aws_ec2.CfnRoutePropsMixin(props, *, strategy=None)

Bases: Mixin

Specifies a route in a route table. For more information, see Routes in the Amazon VPC User Guide .

You must specify either a destination CIDR block or prefix list ID. You must also specify exactly one of the resources as the target.

If you create a route that references a transit gateway in the same template where you create the transit gateway, you must declare a dependency on the transit gateway attachment. The route table cannot use the transit gateway until it has successfully attached to the VPC. Add a DependsOn Attribute in the AWS::EC2::Route resource to explicitly declare a dependency on the AWS::EC2::TransitGatewayAttachment resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-route.html

CloudformationResource:

AWS::EC2::Route

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_ec2 as ec2
import aws_cdk as cdk

# merge_strategy: cdk.IMergeStrategy

cfn_route_props_mixin = ec2.CfnRoutePropsMixin(ec2.CfnRouteMixinProps(
    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",
    route_table_id="routeTableId",
    transit_gateway_id="transitGatewayId",
    vpc_endpoint_id="vpcEndpointId",
    vpc_peering_connection_id="vpcPeeringConnectionId"
),
    strategy=merge_strategy
)

Create a mixin to apply properties to AWS::EC2::Route.

Parameters:
  • props (Union[CfnRouteMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[IMergeStrategy]) – Strategy for merging nested properties. Default: - PropertyMergeStrategy.combine()

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

None

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['carrierGatewayId', 'coreNetworkArn', 'destinationCidrBlock', 'destinationIpv6CidrBlock', 'destinationPrefixListId', 'egressOnlyInternetGatewayId', 'gatewayId', 'instanceId', 'localGatewayId', 'natGatewayId', 'networkInterfaceId', 'routeTableId', 'transitGatewayId', 'vpcEndpointId', 'vpcPeeringConnectionId']

Static Methods

classmethod is_mixin(x)

Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.