NatGatewayProvider Class
Provider for NAT Gateways.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const natGatewayProvider = new ec2.NatGatewayProvider(/* all optional props */ {
eipAllocationIds: ['eipAllocationIds'],
maxDrainDuration: cdk.Duration.minutes(30),
});
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_ec2 as ec2
nat_gateway_provider = ec2.NatGatewayProvider(
eip_allocation_ids=["eipAllocationIds"],
max_drain_duration=cdk.Duration.minutes(30)
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ec2.*;
NatGatewayProvider natGatewayProvider = NatGatewayProvider.Builder.create()
.eipAllocationIds(List.of("eipAllocationIds"))
.maxDrainDuration(Duration.minutes(30))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.EC2;
var natGatewayProvider = new NatGatewayProvider(new NatGatewayProps {
EipAllocationIds = new [] { "eipAllocationIds" },
MaxDrainDuration = Duration.Minutes(30)
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
natGatewayProvider := awscdk.Aws_ec2.NewNatGatewayProvider(&NatGatewayProps{
EipAllocationIds: []*string{
jsii.String("eipAllocationIds"),
},
MaxDrainDuration: cdk.Duration_Minutes(jsii.Number(30)),
})
Initializer
new NatGatewayProvider(props?: NatGatewayProps)
NatGatewayProvider(props: typing.Optional[NatGatewayProps] = None)
new NatGatewayProvider(NatGatewayProps props)
new NatGatewayProvider(NatGatewayProps? props = null)
NewNatGatewayProvider(Props NatGatewayProps)
Properties
configuredGatewaysGatewayConfig[]configured_gatewaystyping.List[GatewayConfig]configuredGatewaysList<GatewayConfig>ConfiguredGatewaysGatewayConfig[]ConfiguredGateways*[]GatewayConfigrequired#Methods
configureNat(options: ConfigureNatOptions): voiddef configure_nat(self, options: ConfigureNatOptions) -> Nonepublic void configureNat(ConfigureNatOptions options)public void ConfigureNat(ConfigureNatOptions options)func ConfigureNat(Options ConfigureNatOptions)#Don't call this directly, the VPC will call it automatically.
configureSubnet(subnet: PrivateSubnet): voiddef configure_subnet(self, subnet: PrivateSubnet) -> Nonepublic void configureSubnet(PrivateSubnet subnet)public void ConfigureSubnet(PrivateSubnet subnet)func ConfigureSubnet(Subnet PrivateSubnet)#Don't call this directly, the VPC will call it automatically.
gateway(props?: NatGatewayProps): NatProvider@staticmethod def gateway(props: typing.Optional[NatGatewayProps] = None) -> NatProviderpublic static NatProvider gateway(NatGatewayProps props)public static NatProvider Gateway(NatGatewayProps? props = null)func Gateway(Props NatGatewayProps) NatProviderstatic#NAT gateways are managed by AWS.
instance(props: NatInstanceProps): NatInstanceProvider@staticmethod def instance(props: NatInstanceProps) -> NatInstanceProviderpublic static NatInstanceProvider instance(NatInstanceProps props)public static NatInstanceProvider Instance(NatInstanceProps props)func Instance(Props NatInstanceProps) NatInstanceProviderstaticdeprecated#notes
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.
instanceV2(props: NatInstanceProps): NatInstanceProviderV2@staticmethod def instance_v2(props: NatInstanceProps) -> NatInstanceProviderV2public static NatInstanceProviderV2 instanceV2(NatInstanceProps props)public static NatInstanceProviderV2 InstanceV2(NatInstanceProps props)func InstanceV2(Props NatInstanceProps) NatInstanceProviderV2static#notes
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.
regionalGateway(props?: RegionalNatGatewayProviderProps): RegionalNatGatewayProvider@staticmethod def regional_gateway(props: typing.Optional[RegionalNatGatewayProviderProps] = None) -> RegionalNatGatewayProviderpublic static RegionalNatGatewayProvider regionalGateway(RegionalNatGatewayProviderProps props)public static RegionalNatGatewayProvider RegionalGateway(RegionalNatGatewayProviderProps? props = null)func RegionalGateway(Props RegionalNatGatewayProviderProps) RegionalNatGatewayProviderstatic#Regional NAT Gateways provide automatic multi-AZ redundancy with a single gateway that scales across availability zones. AWS automatically manages AZ coverage and EIP allocation.