Interface NatGatewayProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,NatGatewayOptions
- All Known Implementing Classes:
NatGatewayProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:49.810Z")
@Stability(Experimental)
public interface NatGatewayProps
extends software.amazon.jsii.JsiiSerializable, NatGatewayOptions
(experimental) Properties to define a 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 TypeInterfaceDescriptionstatic final classA builder forNatGatewayPropsstatic final classAn implementation forNatGatewayProps -
Method Summary
Modifier and TypeMethodDescriptionstatic NatGatewayProps.Builderbuilder()default IVpcV2getVpc()(experimental) The ID of the VPC in which the NAT gateway is located.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.ec2.alpha.NatGatewayOptions
getAllocationId, getConnectivityType, getMaxDrainDuration, getNatGatewayName, getPrivateIpAddress, getSecondaryAllocationIds, getSecondaryPrivateIpAddressCount, getSecondaryPrivateIpAddresses, getSubnet
-
Method Details
-
getVpc
(experimental) The ID of the VPC in which the NAT gateway is located.Default: - no elastic ip associated, required in case of public connectivity if `AllocationId` is not defined
-
builder
- Returns:
- a
NatGatewayProps.BuilderofNatGatewayProps
-