Class CfnRoute
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
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();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe ID of the carrier gateway.The IPv4 CIDR address block used for the destination match.The IPv6 CIDR block used for the destination match.[IPv6 traffic only] The ID of an egress-only internet gateway.The ID of an internet gateway or virtual private gateway attached to your VPC.The ID of a NAT instance in your VPC.The ID of the local gateway.[IPv4 traffic only] The ID of a NAT gateway.The ID of a network interface.The ID of the route table for the route.The ID of a transit gateway.The ID of a VPC endpoint.The ID of a VPC peering connection.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetCarrierGatewayId(String value) The ID of the carrier gateway.voidsetDestinationCidrBlock(String value) The IPv4 CIDR address block used for the destination match.voidThe IPv6 CIDR block used for the destination match.void[IPv6 traffic only] The ID of an egress-only internet gateway.voidsetGatewayId(String value) The ID of an internet gateway or virtual private gateway attached to your VPC.voidsetInstanceId(String value) The ID of a NAT instance in your VPC.voidsetLocalGatewayId(String value) The ID of the local gateway.voidsetNatGatewayId(String value) [IPv4 traffic only] The ID of a NAT gateway.voidsetNetworkInterfaceId(String value) The ID of a network interface.voidsetRouteTableId(String value) The ID of the route table for the route.voidsetTransitGatewayId(String value) The ID of a transit gateway.voidsetVpcEndpointId(String value) The ID of a VPC endpoint.voidsetVpcPeeringConnectionId(String value) The ID of a VPC peering connection.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 newAWS::EC2::Route.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getRouteTableId
The ID of the route table for the route. -
setRouteTableId
The ID of the route table for the route. -
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
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
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 to100.68.0.0/18. -
setDestinationCidrBlock
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 to100.68.0.0/18. -
getDestinationIpv6CidrBlock
The IPv6 CIDR block used for the destination match.Routing decisions are based on the most specific match.
-
setDestinationIpv6CidrBlock
The IPv6 CIDR block used for the destination match.Routing decisions are based on the most specific match.
-
getEgressOnlyInternetGatewayId
[IPv6 traffic only] The ID of an egress-only internet gateway. -
setEgressOnlyInternetGatewayId
[IPv6 traffic only] The ID of an egress-only internet gateway. -
getGatewayId
The ID of an internet gateway or virtual private gateway attached to your VPC. -
setGatewayId
The ID of an internet gateway or virtual private gateway attached to your VPC. -
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
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
The ID of the local gateway. -
setLocalGatewayId
The ID of the local gateway. -
getNatGatewayId
[IPv4 traffic only] The ID of a NAT gateway. -
setNatGatewayId
[IPv4 traffic only] The ID of a NAT gateway. -
getNetworkInterfaceId
The ID of a network interface. -
setNetworkInterfaceId
The ID of a network interface. -
getTransitGatewayId
The ID of a transit gateway. -
setTransitGatewayId
The ID of a transit gateway. -
getVpcEndpointId
The ID of a VPC endpoint.Supported for Gateway Load Balancer endpoints only.
-
setVpcEndpointId
The ID of a VPC endpoint.Supported for Gateway Load Balancer endpoints only.
-
getVpcPeeringConnectionId
The ID of a VPC peering connection. -
setVpcPeeringConnectionId
The ID of a VPC peering connection.
-