CreateNatGateway

GET /?Action=CreateNatGateway
Description

Creates a network address translation (NAT) gateway in the specified public subnet of a VPC.
A NAT gateway enables instances placed in private subnet of this VPC to connect to the Internet, without being accessible from the Internet.
When creating a NAT gateway, you specify the allocation ID of the External IP address (EIP) you want to use as public IP address for the NAT gateway. Once the NAT gateway is created, you need to create a route in the route table of the private subnet, with 0.0.0.0/0 as destination and the ID of the NAT gateway as target. For more information, see AssociateAddress and CreateRoute.
This action also enables you to create multiple NAT gateways in the same VPC (one per public subnet).

Note

You cannot modify the EIP associated with a NAT gateway after its creation. To do so, you need to delete the NAT gateway and create a new one with another EIP.

Body parameter

Required: false
Name: CreateNatGatewayRequest

Name Description Required Schema Default Example

AllocationId

The allocation ID of the EIP to associate with the NAT gateway.
If the EIP is already associated with another resource, you must first disassociate it.

true

string

ClientToken

A unique identifier to manage the idempotency.

false

string

SubnetId

The public subnet where you want to create the NAT gateway.

true

string

Responses
HTTP Code 200
HTTP Code Description Schema

200

CreateNatGatewayResult

Response 200

Response 200

Name Description Required Schema Default Example

clientToken

A unique identifier to manage the idempotency.

false

string

natGateway

Information about the newly created NAT gateway.

false

NatGateway

requestId

The ID of the request.

false

string