A backend system executes inside private subnets of a VPC to process financial transactions. This workload requires outbound connections to both an internal database within the VPC and a public third-party banking API. The database traffic is successful, but all connection attempts to the public API timeout. Which network configuration will enable the workload to connect to the external API?
- Provision a NAT Gateway within a subnet that has a route to an Internet Gateway, and update the workload's subnet route table to direct destination 0.0.0.0/0 traffic to the NAT Gateway.Answer
- BEstablish an AWS PrivateLink VPC endpoint for the third-party banking API, and configure the private subnet's route table to route external traffic to the endpoint.
- CModify the IAM execution role's trust policy to trust the public banking API's domain, allowing secure cross-account API calls to bypass the VPC boundary.
- DStore the public banking API's domain IP addresses in Systems Manager Parameter Store, and enable automatic key rotation to dynamically update the subnet's network access control lists (NACLs).
Answer
Provision a NAT Gateway within a subnet that has a route to an Internet Gateway, and update the workload's subnet route table to direct destination 0.0.0.0/0 traffic to the NAT Gateway.
Providing a NAT Gateway in a public subnet and configuring the private subnet's route table to target it for all external traffic (0.0.0.0/0) allows resources within the private subnet to securely initiate outbound connections to the internet, resolving the timeout issue to the public banking API.
Step-by-Step Solution
Key Concept
Outbound internet connectivity from private VPC subnets using a NAT Gateway