Class NatGateway
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.alpha.NatGateway
- All Implemented Interfaces:
IResource,IRouteTarget,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.809Z")
@Stability(Experimental)
public class NatGateway
extends Resource
implements IRouteTarget
(experimental) Creates a network address translation (NAT) gateway.
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 ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forNatGateway.Nested 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.IRouteTarget
IRouteTarget.Jsii$Default, IRouteTarget.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNatGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedNatGateway(software.amazon.jsii.JsiiObjectRef objRef) NatGateway(software.constructs.Construct scope, String id, NatGatewayProps props) -
Method Summary
Modifier and TypeMethodDescription(experimental) Indicates whether the NAT gateway supports public or private connectivity.getEip()(experimental) Elastic IP created for allocation.(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.(experimental) Id of the NatGateway.(experimental) The NAT gateway CFN resource.(experimental) The ID of the route target.(experimental) The type of router used in the route.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.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
NatGateway
protected NatGateway(software.amazon.jsii.JsiiObjectRef objRef) -
NatGateway
protected NatGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
NatGateway
@Stability(Experimental) public NatGateway(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull NatGatewayProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
getNatGatewayId
(experimental) Id of the NatGateway. -
getResource
(experimental) The NAT gateway CFN resource. -
getRouterTargetId
(experimental) The ID of the route target.- Specified by:
getRouterTargetIdin interfaceIRouteTarget
-
getRouterType
(experimental) The type of router used in the route.- Specified by:
getRouterTypein interfaceIRouteTarget
-
getConnectivityType
(experimental) Indicates whether the NAT gateway supports public or private connectivity.Default: public
-
getEip
(experimental) Elastic IP created for allocation. -
getMaxDrainDuration
(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.Default: '350 seconds'
-