Create NAT Gateway
Create NAT Gateway
- Access the VPC interface:
- Choose Elastic IPs
- Click on Allocate Elastic IP address
- In the Allocate Elastic IP address interface:
- Network border group: choose ap-southeast-1
- Public IPv4 address pool: Choose Amazon’s pool of IPv4 addresses
- Scroll down and choose Allocate
- In the VPC interface:
- Choose NAT gateways
- Click on Create NAT gateway
- In the Create NAT gateway interface:
- Name: Enter
workshop-NATGW
- Subnet: Choose Public Subnet 1
- Connectivity type: Choose Public
- Elastic IP allocation ID: Select recently created Elastic IP
- Review and click on Create NAT gateway.
- In the VPC interface:
- Choose Route tables
- Choose Route Table Private
- Click on Actions and select Edit routes
- In the Edit routes interface:
- Select Add route
- Destination: Enter
0.0.0.0/0
- Target: NAT Gateway and choose workshop-NATGW
- Click on Save changes
- After creating NAT gateway, test
ping aws.amazon.com
successfully from EC2 Private
- Now, let’s execute the
aws s3 ls
command in the terminal EC2 Private.
- After running the command aws s3 ls, we encountered an error: Unable to locate credentials.
- The error observed seems identical to that on the EC2 in the public subnet. This can be explained through the permissions of the S3 bucket.