Create a NAT Gateway
For the server in private subnet, you need to create a NAT gateway, through which servers in private subnet can send requests to the internet.
Background information
Servers in public subnet can directly access the Internet, while servers in private subnet require a NAT gateway to implement Internet access. The NAT gateway resides in public subnet, through which servers in private subnet can initiate one-way connection to the Internet but not receive inbound connections initiated from the internet.
The following diagram shows the architecture of your VPC after you complete this step.
Procedure
- Log in to Amazon VPC Console.
- On the left navigation bar, click NAT Gateways, then click Create NAT gateway.
- In the NAT gateway settings section, complete the
following settings.
- Name: Optional. Enter a name to help you identify the NAT gateway. In this example, enter ycm-nat.
- Subnet: Select the subnet created for the NAT
gateway. In this example, select
ycm-public-subnet2
. - Connectivity type: Select Public.
- Elastic IP allocation ID: Click Allocate Elastic IP to assign an Elastic IP address to the NAT gateway.
- Click Create NAT gateway.
Result
The new created NAT gateway is listed in the NAT Gateways list with the State displayed as Available.
What to do next
Specify a name for the Elastic IP address of the NAT gateway to help you identify it.- Click the Elastic IP address of the NAT gateway to enter the Elastic IP addresses list.
- Hover your mouse over the name tag of the allocated Elastic IP address, click to specify a name for the NAT gateway IP address.
- Click Save.