EC2 has only a private IPv4 address and must call an external IPv4 HTTPS API. The VPC already has an attached IGW and an Available public NAT gateway with an Elastic IP in a public subnet in the same AZ.
The public subnet default route 0.0.0.0/0 points to the IGW. DNS, EC2 HTTPS egress permissions, NACLs and return traffic for both subnets, and API-side permissions are verified. Only the private subnet default route is missing.
Which change uses the existing configuration to reach the API without directly exposing EC2?
Send private EC2 IPv4 traffic to existing public NAT, then use its Elastic IP and IGW path for internet access.
Detailed explanation
Private NAT supports paths to other VPCs or on-premises networks. Traffic sent from private NAT to an IGW is dropped; it does not replace this internet path.
Send private EC2 IPv4 traffic through public NAT and its subnet IGW route, using the NAT Elastic IP for internet access. No public IPv4 address needs to be added to EC2.
An egress-only internet gateway is for IPv6. It does not replace the public NAT route for this IPv4 scenario.
An EC2 instance using an IGW directly for IPv4 needs a public IPv4 address or Elastic IP. This private-only instance cannot gain direct internet connectivity just by changing the route.
Check official documentation
Compare the following points with the official documentation.
In an approved test VPC, check the EC2 subnet route-table association and the NAT ID for 0.0.0.0/0. Verify public connectivity type, Available state, Elastic IP, and the public subnet IGW route. Call the approved HTTPS API from EC2 and compare its response and observed source IP.
Official references
- Official documentation 1
- Official documentation 2
- Official documentation 3
- Official documentation 4
- Official documentation 5
What to confirm
Private-only EC2 receives the API response, and the API observes the NAT Elastic IP as the source IPv4. A route alone does not establish DNS and authorization prerequisites; a successful ping to NAT is not a success criterion.
Key points
- Public NAT gateway
- Elastic IP
- Internet gateway
Notes
- Environment: Official VPC documentation and an approved IPv4 test VPC and HTTPS API with logging and permissions prepared
- Reviewed against the linked AWS documentation on 2026-10-15.
Foundation review
Check both routing stages and translation
This existing zonal public NAT has an Elastic IP and is placed in a public subnet. Route EC2 default traffic to NAT; route the public subnet default traffic to the attached IGW. The internet source uses the NAT Elastic IP. Also verify the route table association for the EC2 subnet.
Distinguish IPv4 and NAT connectivity types
A private-only EC2 instance routed directly to an IGW lacks the public address required for direct IPv4 internet access. IGW drops traffic from private NAT, and an egress-only internet gateway is for IPv6. This scenario uses existing zonal public NAT for IPv4; do not mix requirements for IPv6 or different NAT placement modes.
Verify actual responses and other prerequisites
NAT translates replies for internally initiated connections. DNS, EC2 security groups, both subnet NACLs, and API-side permissions still matter. These are prepared here; verify actual HTTPS responses and the source IP after changing the route. NAT gateways do not respond to ping, so ping alone does not establish success or failure of the API path.