# ConfigureNatOptions

Options passed by the VPC when NAT needs to be configured.

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

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

- 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#L148)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const privateSubnet: ec2.PrivateSubnet;
declare const publicSubnet: ec2.PublicSubnet;
declare const vpc: ec2.Vpc;
const configureNatOptions: ec2.ConfigureNatOptions = {
  natSubnets: [publicSubnet],
  privateSubnets: [privateSubnet],
  vpc: vpc,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

# private_subnet: ec2.PrivateSubnet
# public_subnet: ec2.PublicSubnet
# vpc: ec2.Vpc

configure_nat_options = ec2.ConfigureNatOptions(
    nat_subnets=[public_subnet],
    private_subnets=[private_subnet],
    vpc=vpc
)
```

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.services.ec2.*;

PrivateSubnet privateSubnet;
PublicSubnet publicSubnet;
Vpc vpc;

ConfigureNatOptions configureNatOptions = ConfigureNatOptions.builder()
        .natSubnets(List.of(publicSubnet))
        .privateSubnets(List.of(privateSubnet))
        .vpc(vpc)
        .build();
```

C# / .NET:

```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.AWS.EC2;

PrivateSubnet privateSubnet;
PublicSubnet publicSubnet;
Vpc vpc;

var configureNatOptions = new ConfigureNatOptions {
    NatSubnets = new [] { publicSubnet },
    PrivateSubnets = new [] { privateSubnet },
    Vpc = vpc
};
```

Golang:

```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 "github.com/aws/aws-cdk-go/awscdk"

var privateSubnet PrivateSubnet
var publicSubnet PublicSubnet
var vpc Vpc

configureNatOptions := &ConfigureNatOptions{
	NatSubnets: []PublicSubnet{
		publicSubnet,
	},
	PrivateSubnets: []PrivateSubnet{
		privateSubnet,
	},
	Vpc: vpc,
}
```

## Properties

- `natSubnets`: [PublicSubnet](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.PublicSubnet.html)[] (required) — The public subnets where the NAT providers need to be placed.

  For Regional NAT Gateways, this should be an empty array as they
  don't require public subnets.

- `privateSubnets`: [PrivateSubnet](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.PrivateSubnet.html)[] (required) — The private subnets that need to route through the NAT providers.

  There may be more private subnets than public subnets with NAT providers.

- `vpc`: [Vpc](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html) (required) — The VPC we're configuring NAT for.
