Class NatInstanceProvider

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.NatProvider
software.amazon.awscdk.services.ec2.NatInstanceProvider
All Implemented Interfaces:
IConnectable, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.474Z") @Stability(Stable) public class NatInstanceProvider extends NatProvider implements IConnectable
NAT provider which uses NAT Instances.

Example:

 // Configure the `natGatewayProvider` when defining a Vpc
 NatInstanceProvider natGatewayProvider = NatProvider.instance(NatInstanceProps.builder()
         .instanceType(new InstanceType("t3.small"))
         .build());
 Vpc vpc = Vpc.Builder.create(this, "MyVpc")
         .natGatewayProvider(natGatewayProvider)
         // The 'natGateways' parameter now controls the number of NAT instances
         .natGateways(2)
         .build();
 
  • Constructor Details

    • NatInstanceProvider

      protected NatInstanceProvider(software.amazon.jsii.JsiiObjectRef objRef)
    • NatInstanceProvider

      protected NatInstanceProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • NatInstanceProvider

      @Stability(Stable) public NatInstanceProvider(@NotNull NatInstanceProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • configureNat

      @Stability(Stable) public void configureNat(@NotNull ConfigureNatOptions options)
      Called by the VPC to configure NAT.

      Don't call this directly, the VPC will call it automatically.

      Specified by:
      configureNat in class NatProvider
      Parameters:
      options - This parameter is required.
    • configureSubnet

      @Stability(Stable) public void configureSubnet(@NotNull PrivateSubnet subnet)
      Configures subnet with the gateway.

      Don't call this directly, the VPC will call it automatically.

      Specified by:
      configureSubnet in class NatProvider
      Parameters:
      subnet - This parameter is required.
    • getConfiguredGateways

      @Stability(Stable) @NotNull public List<GatewayConfig> getConfiguredGateways()
      Return list of gateways spawned by the provider.
      Specified by:
      getConfiguredGateways in class NatProvider
    • getConnections

      @Stability(Stable) @NotNull public Connections getConnections()
      Manage the Security Groups associated with the NAT instances.
      Specified by:
      getConnections in interface IConnectable
    • getSecurityGroup

      @Stability(Stable) @NotNull public ISecurityGroup getSecurityGroup()
      The Security Group associated with the NAT instances.