Amazon API Gateway is an Amazon Web Service that allows us to create, deploy, and manage different types of APIs, such as REST and WebSocket. It also allows you to create private REST APIs that can only be accessed through resources inside a Virtual Private Cloud (VPC) through a VPC endpoint.
In this Cloud Lab, you’ll first create a VPC, attach a security group to it, and then add a VPC endpoint. You’ll then create a Lambda function that will return a simple string when the function is invoked. You’ll use the API Gateway to create and configure a private API so that it can only be accessed by the resources inside your VPC and invokes your Lambda function when its GET method is called. Finally, you’ll create an IDE through Cloud9 inside your VPC and use it to send a request to your private API.
After completing this Cloud Lab, you’ll have a strong knowledge of private APIs in API Gateway and can create your private RESTful APIs. You can configure these APIs to allow resources inside a specific VPC to access your APIs.
The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab: