interface NatGatewayOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ec2.Alpha.NatGatewayOptions |
Go | github.com/aws/aws-cdk-go/awsec2alpha/v2#NatGatewayOptions |
Java | software.amazon.awscdk.services.ec2.alpha.NatGatewayOptions |
Python | aws_cdk.aws_ec2_alpha.NatGatewayOptions |
TypeScript (source) | @aws-cdk/aws-ec2-alpha ยป NatGatewayOptions |
Options to define a NAT gateway.
Example
const stack = new Stack();
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.PUBLIC });
myVpc.addInternetGateway();
myVpc.addNatGateway({
subnet: subnet,
connectivityType: NatConnectivityType.PUBLIC,
});
Properties
Name | Type | Description |
---|---|---|
subnet | ISubnet | The subnet in which the NAT gateway is located. |
allocation | string | AllocationID of Elastic IP address that's associated with the NAT gateway. |
connectivity | Nat | Indicates whether the NAT gateway supports public or private connectivity. |
max | Duration | The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. |
nat | string | The resource name of the NAT gateway. |
private | string | The private IPv4 address to assign to the NAT gateway. |
secondary | string[] | Secondary EIP allocation IDs. |
secondary | number | The number of secondary private IPv4 addresses you want to assign to the NAT gateway. |
secondary | string[] | Secondary private IPv4 addresses. |
subnet
Type:
ISubnet
The subnet in which the NAT gateway is located.
allocationId?
Type:
string
(optional, default: attr.allocationID of a new Elastic IP created by default
//TODO: ADD L2 for elastic ip)
AllocationID of Elastic IP address that's associated with the NAT gateway.
This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
connectivityType?
Type:
Nat
(optional, default: NatConnectivityType.Public)
Indicates whether the NAT gateway supports public or private connectivity.
maxDrainDuration?
Type:
Duration
(optional, default: 350seconds)
The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
natGatewayName?
Type:
string
(optional, default: NATGW provisioned without any name)
The resource name of the NAT gateway.
privateIpAddress?
Type:
string
(optional, default: If you don't provide an address, a private IPv4 address will be automatically assigned.)
The private IPv4 address to assign to the NAT gateway.
secondaryAllocationIds?
Type:
string[]
(optional, default: no secondary allocation IDs attached to NATGW)
Secondary EIP allocation IDs.
See also: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
secondaryPrivateIpAddressCount?
Type:
number
(optional, default: no secondary allocation IDs associated with NATGW)
The number of secondary private IPv4 addresses you want to assign to the NAT gateway.
SecondaryPrivateIpAddressCount
and SecondaryPrivateIpAddresses
cannot be
set at the same time.
See also: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
secondaryPrivateIpAddresses?
Type:
string[]
(optional, default: no secondary private IpAddresses associated with NATGW)
Secondary private IPv4 addresses.
SecondaryPrivateIpAddressCount
and SecondaryPrivateIpAddresses
cannot be
set at the same time.
See also: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating