Experimental
@aws-cdk/aws-ec2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
NatGatewayOptions Struct
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
allocationIdoptionalstringallocation_idoptionalstrallocationIdoptionalStringAllocationIdoptionalstringAllocationIdoptional*string#Default: attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
connectivityTypeoptionalNatConnectivityTypeconnectivity_typeoptionalNatConnectivityTypeconnectivityTypeoptionalNatConnectivityTypeConnectivityTypeoptionalNatConnectivityTypeConnectivityTypeoptionalNatConnectivityType= NatConnectivityType.Public#maxDrainDurationoptionalDurationmax_drain_durationoptionalDurationmaxDrainDurationoptionalDurationMaxDrainDurationoptionalDurationMaxDrainDurationoptionalDuration= Duration.seconds(350)#natGatewayNameoptionalstringnat_gateway_nameoptionalstrnatGatewayNameoptionalStringNatGatewayNameoptionalstringNatGatewayNameoptional*string#Default: NATGW provisioned without any name
privateIpAddressoptionalstringprivate_ip_addressoptionalstrprivateIpAddressoptionalStringPrivateIpAddressoptionalstringPrivateIpAddressoptional*string#Default: If you don't provide an address, a private IPv4 address will be automatically assigned.
secondaryAllocationIdsoptionalstring[]secondary_allocation_idsoptionaltyping.List[str]secondaryAllocationIdsoptionalList<String>SecondaryAllocationIdsoptionalstring[]SecondaryAllocationIdsoptional*[]*string#Default: no secondary allocation IDs attached to NATGW
secondaryPrivateIpAddressCountoptionalnumbersecondary_private_ip_address_countoptionalint | floatsecondaryPrivateIpAddressCountoptionalNumberSecondaryPrivateIpAddressCountoptionaldoubleSecondaryPrivateIpAddressCountoptional*float64#Default: no secondary allocation IDs associated with NATGW
SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
secondaryPrivateIpAddressesoptionalstring[]secondary_private_ip_addressesoptionaltyping.List[str]secondaryPrivateIpAddressesoptionalList<String>SecondaryPrivateIpAddressesoptionalstring[]SecondaryPrivateIpAddressesoptional*[]*string#Default: no secondary private IpAddresses associated with NATGW
SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.