> **Experimental**
>
> `@aws-cdk/aws-ec2-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# NatConnectivityType

Indicates whether the NAT gateway supports public or private connectivity.

The default is public connectivity.
See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-natgateway.html#cfn-ec2-natgateway-connectivitytype

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/route.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0-alpha.0/packages/@aws-cdk/aws-ec2-alpha/lib/route.ts#L19)

## Example

```ts
const myVpc = new VpcV2(this, 'Vpc');
const routeTable = new RouteTable(this, 'RouteTable', {
  vpc: myVpc,
});
const subnet = new SubnetV2(this, 'Subnet', {
  vpc: myVpc,
  availabilityZone: 'eu-west-2a',
  ipv4CidrBlock: new IpCidr('10.0.0.0/24'),
  subnetType: SubnetType.PRIVATE_ISOLATED });

const natgw = new NatGateway(this, 'NatGW', {
  subnet: subnet,
  vpc: myVpc,
  connectivityType: NatConnectivityType.PRIVATE,
  privateIpAddress: '10.0.0.42',
});
new Route(this, 'NatGwRoute', {
  routeTable,
  destination: '0.0.0.0/0',
  target: { gateway: natgw },
});
```

## Members

| Member | Description |
| --- | --- |
| `PUBLIC` | Sets Connectivity type to PUBLIC. |
| `PRIVATE` | Sets Connectivity type to PRIVATE. |

## Referenced by

- [`NatGateway`](/v2/docs/@aws-cdk_aws-ec2-alpha.NatGateway).connectivityType
- [`NatGatewayOptions`](/v2/docs/@aws-cdk_aws-ec2-alpha.NatGatewayOptions).connectivityType
