CfnNatGatewayPropsMixin
- class aws_cdk.mixins_preview.aws_ec2.mixins.CfnNatGatewayPropsMixin(props, *, strategy=None)
Bases:
MixinSpecifies a network address translation (NAT) gateway in the specified subnet.
You can create either a public NAT gateway or a private NAT gateway. The default is a public NAT gateway. If you create a public NAT gateway, you must specify an elastic IP address.
With a NAT gateway, instances in a private subnet can connect to the internet, other AWS services, or an on-premises network using the IP address of the NAT gateway. For more information, see NAT gateways in the Amazon VPC User Guide .
If you add a default route (
AWS::EC2::Routeresource) that points to a NAT gateway, specify the NAT gateway ID for the route’sNatGatewayIdproperty. .. epigraph:When you associate an Elastic IP address or secondary Elastic IP address with a public NAT gateway, the network border group of the Elastic IP address must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. Otherwise, the NAT gateway fails to launch. You can see the network border group for the AZ by viewing the details of the subnet. Similarly, you can view the network border group for the Elastic IP address by viewing its details. For more information, see `Allocate an Elastic IP address <https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#allocate-eip>`_ in the *Amazon VPC User Guide* .
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-natgateway.html
- CloudformationResource:
AWS::EC2::NatGateway
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_ec2 import mixins as ec2_mixins cfn_nat_gateway_props_mixin = ec2_mixins.CfnNatGatewayPropsMixin(ec2_mixins.CfnNatGatewayMixinProps( allocation_id="allocationId", availability_mode="availabilityMode", availability_zone_addresses=[ec2_mixins.CfnNatGatewayPropsMixin.AvailabilityZoneAddressProperty( allocation_ids=["allocationIds"], availability_zone="availabilityZone", availability_zone_id="availabilityZoneId" )], connectivity_type="connectivityType", max_drain_duration_seconds=123, private_ip_address="privateIpAddress", secondary_allocation_ids=["secondaryAllocationIds"], secondary_private_ip_address_count=123, secondary_private_ip_addresses=["secondaryPrivateIpAddresses"], subnet_id="subnetId", tags=[CfnTag( key="key", value="value" )], vpc_id="vpcId" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::EC2::NatGateway.- Parameters:
props (
Union[CfnNatGatewayMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['allocationId', 'availabilityMode', 'availabilityZoneAddresses', 'connectivityType', 'maxDrainDurationSeconds', 'privateIpAddress', 'secondaryAllocationIds', 'secondaryPrivateIpAddressCount', 'secondaryPrivateIpAddresses', 'subnetId', 'tags', 'vpcId']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AvailabilityZoneAddressProperty
- class CfnNatGatewayPropsMixin.AvailabilityZoneAddressProperty(*, allocation_ids=None, availability_zone=None, availability_zone_id=None)
Bases:
objectFor regional NAT gateways only: The configuration specifying which Elastic IP address (EIP) to use for handling outbound NAT traffic from a specific Availability Zone.
A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region.
For more information, see Regional NAT gateways for automatic multi-AZ expansion in the Amazon VPC User Guide .
- Parameters:
allocation_ids (
Optional[Sequence[str]]) – The allocation IDs of the Elastic IP addresses (EIPs) to be used for handling outbound NAT traffic in this specific Availability Zone.availability_zone (
Optional[str]) – For regional NAT gateways only: The Availability Zone where this specific NAT gateway configuration will be active. Each AZ in a regional NAT gateway has its own configuration to handle outbound NAT traffic from that AZ. A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region.availability_zone_id (
Optional[str]) – For regional NAT gateways only: The ID of the Availability Zone where this specific NAT gateway configuration will be active. Each AZ in a regional NAT gateway has its own configuration to handle outbound NAT traffic from that AZ. Use this instead of AvailabilityZone for consistent identification of AZs across AWS Regions. A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ec2 import mixins as ec2_mixins availability_zone_address_property = ec2_mixins.CfnNatGatewayPropsMixin.AvailabilityZoneAddressProperty( allocation_ids=["allocationIds"], availability_zone="availabilityZone", availability_zone_id="availabilityZoneId" )
Attributes
- allocation_ids
The allocation IDs of the Elastic IP addresses (EIPs) to be used for handling outbound NAT traffic in this specific Availability Zone.
- availability_zone
The Availability Zone where this specific NAT gateway configuration will be active.
Each AZ in a regional NAT gateway has its own configuration to handle outbound NAT traffic from that AZ.
A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region.
- availability_zone_id
The ID of the Availability Zone where this specific NAT gateway configuration will be active.
Each AZ in a regional NAT gateway has its own configuration to handle outbound NAT traffic from that AZ. Use this instead of AvailabilityZone for consistent identification of AZs across AWS Regions.
A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region.