Initialize REST API setup in API Gateway - Amazon API Gateway

Initialize REST API setup in API Gateway

For this example, we use a simplified PetStore API, with the HTTP integration, that exposes the GET /pets and GET /pets/{petId} methods. The methods are integrated with the two HTTP endpoints, respectively, of and{petId}. The API handles 200 OK responses. The examples focus on the essential programming tasks for creating an API in API Gateway, taking advantage of default settings when possible.

Because of the default settings, the resulting API is edge-optimized. An alternative is to set up a regional API. To set up a regional API, you must set explicitly the endpoint type of the API as REGIONAL. To set up an edge-optimized API explicitly, you can set EDGE as the type of the endpointConfiguration.

When setting up an API, you must choose a region. When deployed, the API is region-specific. For an edge-optimized API, the base URL is of the http[s]://{restapi-id} format, where {restapi-id} is the API's id value generated by API Gateway. You can assign a custom domain name (for example, as the API's host name and call the API with a base URL of the format.