AWS Certified Solutions Architect – Professional — Question 746

A company is using Amazon API Gateway to deploy a private REST API that will provide access to sensitive data. The API must be accessible only from an application that is deployed in a VPC. The company deploys the API successfully. However, the API is not accessible from an Amazon EC2 instance that is deployed in the VPC.

Which solution will provide connectivity between the EC2 instance and the API?

Answer options

Correct answer: B

Explanation

To connect to a private API Gateway REST API from inside a VPC, you need to create an interface VPC endpoint and configure its policy to allow the execute-api:Invoke action. Enabling private DNS naming allows clients within the VPC to use the default public DNS names of the API Gateway, which resolve directly to the private IP addresses of the VPC endpoint. Additionally, configuring the API's resource policy to allow traffic from the VPC endpoint secures and completes the private network route.