# NatGatewayProps

Struct · Stable

Properties for a NAT gateway.

Used as props by: [NatGatewayProvider](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.NatGatewayProvider.html)
Used as argument in: [NatProvider.gateway](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.NatProvider.html#gateway)

- Source: [`aws-ec2/lib/nat.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/nat.ts#L174)
- Type last changed: v2.272.0 · 30 Sep 2026

## Example

TypeScript:

```ts
// 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 natGatewayProps: ec2.NatGatewayProps = {
  eipAllocationIds: ['eipAllocationIds'],
  maxDrainDuration: cdk.Duration.minutes(30),
};
```

Python:

```python
# 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_props = ec2.NatGatewayProps(
    eip_allocation_ids=["eipAllocationIds"],
    max_drain_duration=cdk.Duration.minutes(30)
)
```

Java:

```java
// 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.*;

NatGatewayProps natGatewayProps = NatGatewayProps.builder()
        .eipAllocationIds(List.of("eipAllocationIds"))
        .maxDrainDuration(Duration.minutes(30))
        .build();
```

C#:

```csharp
// 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 natGatewayProps = new NatGatewayProps {
    EipAllocationIds = new [] { "eipAllocationIds" },
    MaxDrainDuration = Duration.Minutes(30)
};
```

Go:

```go
// 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"

natGatewayProps := &NatGatewayProps{
	EipAllocationIds: []*string{
		jsii.String("eipAllocationIds"),
	},
	MaxDrainDuration: cdk.Duration_Minutes(jsii.Number(30)),
}
```

## Properties

- `eipAllocationIds`: string[] — EIP allocation IDs for the NAT gateways.

  **Default:** No fixed EIPs allocated for the NAT gateways

- `maxDrainDuration`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(350) — Maximum amount of time to wait before forcibly releasing IP addresses if connections are still in progress.
