@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)",
date="2023-03-22T19:35:43.124Z")
public abstract class NatProvider
extends software.amazon.jsii.JsiiObject
Determines what type of NAT provider to create, either NAT gateways or NAT instance.
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();
Modifier | Constructor and Description |
---|---|
protected |
NatProvider() |
protected |
NatProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
NatProvider(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
abstract void |
configureNat(ConfigureNatOptions options)
Called by the VPC to configure NAT.
|
abstract void |
configureSubnet(PrivateSubnet subnet)
Configures subnet with the gateway.
|
static NatProvider |
gateway()
Use NAT Gateways to provide NAT services for your VPC.
|
static NatProvider |
gateway(NatGatewayProps props)
Use NAT Gateways to provide NAT services for your VPC.
|
abstract java.util.List<GatewayConfig> |
getConfiguredGateways()
Return list of gateways spawned by the provider.
|
static NatInstanceProvider |
instance(NatInstanceProps props)
Use NAT instances to provide NAT services for your VPC.
|
protected NatProvider(software.amazon.jsii.JsiiObjectRef objRef)
protected NatProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected NatProvider()
public static NatProvider gateway(NatGatewayProps props)
NAT gateways are managed by AWS.
props
- public static NatProvider gateway()
NAT gateways are managed by AWS.
public static NatInstanceProvider instance(NatInstanceProps props)
NAT instances are managed by you, but in return allow more configuration.
Be aware that instances created using this provider will not be automatically replaced if they are stopped for any reason. You should implement your own NatProvider based on AutoScaling groups if you need that.
props
- This parameter is required.public abstract void configureNat(ConfigureNatOptions options)
Don't call this directly, the VPC will call it automatically.
options
- This parameter is required.public abstract void configureSubnet(PrivateSubnet subnet)
Don't call this directly, the VPC will call it automatically.
subnet
- This parameter is required.public abstract java.util.List<GatewayConfig> getConfiguredGateways()