Interface NatGatewayProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, NatGatewayOptions
All Known Implementing Classes:
NatGatewayProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:11.422Z") @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();
 
  • Method Details

    • getVpc

      @Stability(Experimental) @Nullable default IVpcV2 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

      @Stability(Experimental) static NatGatewayProps.Builder builder()
      Returns:
      a NatGatewayProps.Builder of NatGatewayProps