AWS::EC2::NatGatewaySpecifies 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](https://docs.aws.amazon.com/...
12 configurable properties. Click a row to see details.
| Property | Type | Flags |
|---|---|---|
AllocationId | string | Create-only |
AvailabilityMode | string | Create-only |
AvailabilityZoneAddresses | Array<AvailabilityZoneAddress> | |
ConnectivityType | string | Create-only |
MaxDrainDurationSeconds | integer | Write-only |
PrivateIpAddress | string | Create-only |
SecondaryAllocationIds | Array<string> | |
SecondaryPrivateIpAddressCount | integer | |
SecondaryPrivateIpAddresses | Array<string> | |
SubnetId | string | Create-only |
Tags | Array<Tag> | |
VpcId | string | Create-only |
Values returned after the resource is created. Access these with Fn::GetAtt.
| Attribute | Type | Description |
|---|---|---|
AutoProvisionZones | string | - |
AutoScalingIps | string | - |
EniId | string | - |
NatGatewayId | string | - |
RouteTableId | string | - |
A minimal template with required properties and common optional ones.
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::EC2::NatGateway
Resources:
MyResource:
Type: AWS::EC2::NatGateway
Properties:
Tags:
- Key: Environment
Value: ProductionPermissions CloudFormation needs in your IAM role to manage this resource.
ec2:CreateNatGatewayec2:DescribeNatGatewaysec2:CreateTagsec2:DeleteNatGatewayec2:DescribeNatGatewaysec2:DescribeNatGatewaysec2:DescribeNatGatewaysec2:DescribeNatGatewaysec2:CreateTagsec2:DeleteTagsec2:AssociateNatGatewayAddressec2:DisassociateNatGatewayAddressec2:AssignPrivateNatGatewayAddressec2:UnassignPrivateNatGatewayAddressEverything you need to know about EC2 on one page. HD quality, print-friendly.
Download Free InfographicNatGatewayIdThese properties cannot be changed after the resource is created. Updating them triggers a replacement.
VpcIdSubnetIdConnectivityTypeAllocationIdPrivateIpAddressAvailabilityMode