aws-cdk-lib.aws_ec2.NatInstanceProvider

class NatInstanceProvider

LanguageType name
.NETAmazon.CDK.AWS.EC2.NatInstanceProvider
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#NatInstanceProvider
Javasoftware.amazon.awscdk.services.ec2.NatInstanceProvider
Pythonaws_cdk.aws_ec2.NatInstanceProvider
TypeScript (source)aws-cdk-lib » aws_ec2 » NatInstanceProvider

Implements IConnectable

Extends NatProvider

NAT provider which uses NAT Instances.

Example

    // Configure the `natGatewayProvider` when defining a Vpc
    const natGatewayProvider = ec2.NatProvider.instance({
      instanceType: new ec2.InstanceType('t3.small'),
    });

    const vpc = new ec2.Vpc(this, 'MyVpc', {
      natGatewayProvider,

      // The 'natGateways' parameter now controls the number of NAT instances
      natGateways: 2,
    });

Initializer

new NatInstanceProvider(props: NatInstanceProps)

Parameters

  • props NatInstanceProps

Properties

NameTypeDescription
configuredGatewaysGatewayConfig[]Return list of gateways spawned by the provider.
connectionsConnectionsManage the Security Groups associated with the NAT instances.
securityGroupISecurityGroupThe Security Group associated with the NAT instances.

configuredGateways

Type: GatewayConfig[]

Return list of gateways spawned by the provider.


connections

Type: Connections

Manage the Security Groups associated with the NAT instances.


securityGroup

Type: ISecurityGroup

The Security Group associated with the NAT instances.

Methods

NameDescription
configureNat(options)Called by the VPC to configure NAT.
configureSubnet(subnet)Configures subnet with the gateway.

configureNat(options)

public configureNat(options: ConfigureNatOptions): void

Parameters

  • options ConfigureNatOptions

Called by the VPC to configure NAT.

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


configureSubnet(subnet)

public configureSubnet(subnet: PrivateSubnet): void

Parameters

  • subnet PrivateSubnet

Configures subnet with the gateway.

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