Class Route
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.alpha.Route
- All Implemented Interfaces:
IResource,IRouteV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:49.812Z")
@Stability(Experimental)
public class Route
extends Resource
implements IRouteV2
(experimental) Creates a new route with added functionality.
Example:
VpcV2 myVpc = new VpcV2(this, "Vpc");
RouteTable routeTable = RouteTable.Builder.create(this, "RouteTable")
.vpc(myVpc)
.build();
SubnetV2 subnet = SubnetV2.Builder.create(this, "Subnet")
.vpc(myVpc)
.availabilityZone("eu-west-2a")
.ipv4CidrBlock(new IpCidr("10.0.0.0/24"))
.subnetType(SubnetType.PRIVATE_ISOLATED)
.build();
NatGateway natgw = NatGateway.Builder.create(this, "NatGW")
.subnet(subnet)
.vpc(myVpc)
.connectivityType(NatConnectivityType.PRIVATE)
.privateIpAddress("10.0.0.42")
.build();
Route.Builder.create(this, "NatGwRoute")
.routeTable(routeTable)
.destination("0.0.0.0/0")
.target(Map.of("gateway", natgw))
.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.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.alpha.IRouteV2
IRouteV2.Jsii$Default, IRouteV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedRoute(software.amazon.jsii.JsiiObjectRef objRef) Route(software.constructs.Construct scope, String id, RouteProps props) -
Method Summary
Modifier and TypeMethodDescription(experimental) The IPv4 or IPv6 CIDR block used for the destination match.(experimental) The route CFN resource.(experimental) The route table for the route.(experimental) The gateway or endpoint targeted by the route.(experimental) The type of router the route is targeting.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
Route
protected Route(software.amazon.jsii.JsiiObjectRef objRef) -
Route
protected Route(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Route
@Stability(Experimental) public Route(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull RouteProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
getDestination
(experimental) The IPv4 or IPv6 CIDR block used for the destination match.Routing decisions are based on the most specific match.
- Specified by:
getDestinationin interfaceIRouteV2
-
getRouteTable
(experimental) The route table for the route.- Specified by:
getRouteTablein interfaceIRouteV2
-
getTarget
(experimental) The gateway or endpoint targeted by the route. -
getTargetRouterType
(experimental) The type of router the route is targeting. -
getResource
(experimental) The route CFN resource.
-