class NatInstanceProvider
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.EC2.NatInstanceProvider |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#NatInstanceProvider |
Java | software.amazon.awscdk.services.ec2.NatInstanceProvider |
Python | aws_cdk.aws_ec2.NatInstanceProvider |
TypeScript (source) | aws-cdk-lib » aws_ec2 » NatInstanceProvider |
⚠️ Deprecated: use NatInstanceProviderV2. NatInstanceProvider is deprecated since the instance image used has reached EOL on Dec 31 2023
Implements
IConnectable
Extends
Nat
NAT provider which uses NAT Instances.
Example
const natInstanceProvider = ec2.NatProvider.instance({
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T4G, ec2.InstanceSize.LARGE),
machineImage: new ec2.AmazonLinuxImage(),
creditSpecification: ec2.CpuCredits.UNLIMITED,
});
new ec2.Vpc(this, 'VPC', {
natGatewayProvider: natInstanceProvider,
});
Initializer
new NatInstanceProvider(props: NatInstanceProps)
⚠️ Deprecated: use NatInstanceProviderV2. NatInstanceProvider is deprecated since the instance image used has reached EOL on Dec 31 2023
Parameters
- props
NatInstance Props
Properties
| Name | Type | Description |
|---|---|---|
| configured | Gateway[] | Return list of gateways spawned by the provider. |
| connections | Connections | Manage the Security Groups associated with the NAT instances. |
| security | ISecurity | The Security Group associated with the NAT instances. |
configuredGateways
⚠️ Deprecated: use NatInstanceProviderV2. NatInstanceProvider is deprecated since the instance image used has reached EOL on Dec 31 2023
Type:
Gateway[]
Return list of gateways spawned by the provider.
connections
⚠️ Deprecated: use NatInstanceProviderV2. NatInstanceProvider is deprecated since the instance image used has reached EOL on Dec 31 2023
Type:
Connections
Manage the Security Groups associated with the NAT instances.
securityGroup
⚠️ Deprecated: use NatInstanceProviderV2. NatInstanceProvider is deprecated since the instance image used has reached EOL on Dec 31 2023
Type:
ISecurity
The Security Group associated with the NAT instances.
Methods
| Name | Description |
|---|---|
| configure | Called by the VPC to configure NAT. |
| configure | Configures subnet with the gateway. |
configureNat(options)
public configureNat(options: ConfigureNatOptions): void
⚠️ Deprecated: use NatInstanceProviderV2. NatInstanceProvider is deprecated since the instance image used has reached EOL on Dec 31 2023
Parameters
- options
ConfigureNat Options
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
⚠️ Deprecated: use NatInstanceProviderV2. NatInstanceProvider is deprecated since the instance image used has reached EOL on Dec 31 2023
Parameters
- subnet
PrivateSubnet
Configures subnet with the gateway.
Don't call this directly, the VPC will call it automatically.

.NET
Go
Java
Python
TypeScript (