A company deployed a private REST API in API Gateway that must be accessible only from an application inside a VPC. An EC2 instance in the VPC cannot reach the API. Which solution provides connectivity between the EC2 instance and the private API?
Choose an answer
Tap an option to check your answer.
Correct answer: Create an interface VPC endpoint for API Gateway. Attach an endpoint policy that allows the execute-api:Invoke action. Enable private DNS for the VPC endpoint. Configure the API resource policy to allow access from the VPC endpoint. Use the API endpoint DNS names to call the API..
Why this is the answer
The correct solution involves creating an interface VPC endpoint for API Gateway. This allows private access to API Gateway from within your VPC without traversing the public internet. Enabling private DNS for the VPC endpoint ensures that the default API Gateway endpoint DNS names resolve privately to the VPC endpoint, simplifying application configuration. The endpoint policy should grant the execute-api:Invoke action, which is the specific permission needed to call the API. Finally, the API's resource policy must be configured to permit access from the VPC endpoint. The first incorrect option is wrong because it disables private DNS, requiring applications to use the specific VPC endpoint DNS name, and apigateway: is overly permissive. The third and fourth options are incorrect because VPC Links and Load Balancers are used for private integration from API Gateway to backend services within a VPC, not for accessing API Gateway from a VPC.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed