Class CfnRoute

All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.911Z") @Stability(Stable) public class CfnRoute extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::Route.

Specifies a route in a route table.

You must specify either DestinationCidrBlock or DestinationIpv6CidrBlock , plus the ID of one of the target resources.

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.

Example:

 // 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.*;
 CfnRoute cfnRoute = CfnRoute.Builder.create(this, "MyCfnRoute")
         .routeTableId("routeTableId")
         // the properties below are optional
         .carrierGatewayId("carrierGatewayId")
         .destinationCidrBlock("destinationCidrBlock")
         .destinationIpv6CidrBlock("destinationIpv6CidrBlock")
         .egressOnlyInternetGatewayId("egressOnlyInternetGatewayId")
         .gatewayId("gatewayId")
         .instanceId("instanceId")
         .localGatewayId("localGatewayId")
         .natGatewayId("natGatewayId")
         .networkInterfaceId("networkInterfaceId")
         .transitGatewayId("transitGatewayId")
         .vpcEndpointId("vpcEndpointId")
         .vpcPeeringConnectionId("vpcPeeringConnectionId")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnRoute

      protected CfnRoute(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnRoute

      protected CfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnRoute

      @Stability(Stable) public CfnRoute(@NotNull Construct scope, @NotNull String id, @NotNull CfnRouteProps props)
      Create a new AWS::EC2::Route.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getRouteTableId

      @Stability(Stable) @NotNull public String getRouteTableId()
      The ID of the route table for the route.
    • setRouteTableId

      @Stability(Stable) public void setRouteTableId(@NotNull String value)
      The ID of the route table for the route.
    • getCarrierGatewayId

      @Stability(Stable) @Nullable public String getCarrierGatewayId()
      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.

    • setCarrierGatewayId

      @Stability(Stable) public void setCarrierGatewayId(@Nullable String value)
      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.

    • getDestinationCidrBlock

      @Stability(Stable) @Nullable public String getDestinationCidrBlock()
      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 .

    • setDestinationCidrBlock

      @Stability(Stable) public void setDestinationCidrBlock(@Nullable String value)
      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 .

    • getDestinationIpv6CidrBlock

      @Stability(Stable) @Nullable public String getDestinationIpv6CidrBlock()
      The IPv6 CIDR block used for the destination match.

      Routing decisions are based on the most specific match.

    • setDestinationIpv6CidrBlock

      @Stability(Stable) public void setDestinationIpv6CidrBlock(@Nullable String value)
      The IPv6 CIDR block used for the destination match.

      Routing decisions are based on the most specific match.

    • getEgressOnlyInternetGatewayId

      @Stability(Stable) @Nullable public String getEgressOnlyInternetGatewayId()
      [IPv6 traffic only] The ID of an egress-only internet gateway.
    • setEgressOnlyInternetGatewayId

      @Stability(Stable) public void setEgressOnlyInternetGatewayId(@Nullable String value)
      [IPv6 traffic only] The ID of an egress-only internet gateway.
    • getGatewayId

      @Stability(Stable) @Nullable public String getGatewayId()
      The ID of an internet gateway or virtual private gateway attached to your VPC.
    • setGatewayId

      @Stability(Stable) public void setGatewayId(@Nullable String value)
      The ID of an internet gateway or virtual private gateway attached to your VPC.
    • getInstanceId

      @Stability(Stable) @Nullable public String getInstanceId()
      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.

    • setInstanceId

      @Stability(Stable) public void setInstanceId(@Nullable String value)
      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.

    • getLocalGatewayId

      @Stability(Stable) @Nullable public String getLocalGatewayId()
      The ID of the local gateway.
    • setLocalGatewayId

      @Stability(Stable) public void setLocalGatewayId(@Nullable String value)
      The ID of the local gateway.
    • getNatGatewayId

      @Stability(Stable) @Nullable public String getNatGatewayId()
      [IPv4 traffic only] The ID of a NAT gateway.
    • setNatGatewayId

      @Stability(Stable) public void setNatGatewayId(@Nullable String value)
      [IPv4 traffic only] The ID of a NAT gateway.
    • getNetworkInterfaceId

      @Stability(Stable) @Nullable public String getNetworkInterfaceId()
      The ID of a network interface.
    • setNetworkInterfaceId

      @Stability(Stable) public void setNetworkInterfaceId(@Nullable String value)
      The ID of a network interface.
    • getTransitGatewayId

      @Stability(Stable) @Nullable public String getTransitGatewayId()
      The ID of a transit gateway.
    • setTransitGatewayId

      @Stability(Stable) public void setTransitGatewayId(@Nullable String value)
      The ID of a transit gateway.
    • getVpcEndpointId

      @Stability(Stable) @Nullable public String getVpcEndpointId()
      The ID of a VPC endpoint.

      Supported for Gateway Load Balancer endpoints only.

    • setVpcEndpointId

      @Stability(Stable) public void setVpcEndpointId(@Nullable String value)
      The ID of a VPC endpoint.

      Supported for Gateway Load Balancer endpoints only.

    • getVpcPeeringConnectionId

      @Stability(Stable) @Nullable public String getVpcPeeringConnectionId()
      The ID of a VPC peering connection.
    • setVpcPeeringConnectionId

      @Stability(Stable) public void setVpcPeeringConnectionId(@Nullable String value)
      The ID of a VPC peering connection.