Create NAT Gateway

Create NAT Gateway

  1. Access the VPC interface:
    • Choose Elastic IPs
    • Click on Allocate Elastic IP address

ConnectPrivate

  1. 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

ConnectPrivate

  1. Scroll down and choose Allocate

ConnectPrivate

  1. In the VPC interface:
    • Choose NAT gateways
    • Click on Create NAT gateway

ConnectPrivate

  1. 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

ConnectPrivate

  1. Review and click on Create NAT gateway.

ConnectPrivate

Configure the Route Table Private

  1. In the VPC interface:
    • Choose Route tables
    • Choose Route Table Private
    • Click on Actions and select Edit routes

ConnectPrivate

  1. 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

ConnectPrivate

  1. After creating NAT gateway, test ping aws.amazon.com successfully from EC2 Private

ConnectPrivate

  1. Now, let’s execute the aws s3 ls command in the terminal EC2 Private.

ConnectPrivate

  1. 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.

ConnectPrivate