Amazon API Gateway
Developer Guide

Import a Regional API into API Gateway

When importing an API, you can choose the regional endpoint configuration for the API. You can use the API Gateway console, AWS CLI, an AWS SDK, or the API Gateway REST API.

When you export an API, the API endpoint configuration is not included in the exported API definitions.

Import a Regional API Using the API Gateway Console

To import an API of a regional endpoint using the API Gateway console, do the following:

  1. Sign in to the API Gateway console and choose + Create API.

  2. Select the Import from OpenAPI option under Create new API.

  3. Copy an API's OpenAPI definition and paste it into the code editor, or choose Select OpenAPI File to load an OpenAPI file from a local drive.

  4. Under Settings, for Endpoint Type, choose Regional..

  5. Choose Import to start importing the OpenAPI definitions.

Import a Regional API Using the AWS CLI

To import an API from an OpenAPI definition file using the AWS CLI, use the import-rest-api command:

aws apigateway import-rest-api \ --endpointConfigurationTypes 'REGIONAL' \ --fail-on-warnings \ --body 'file://path/to/API_OpenAPI_template.json'

Import a Regional API Using the API Gateway REST API

To use the API Gateway REST API to create a regional API by importing an OpenAPI definition file, call the following restapi:import link-relation:

POST /restapis?mode=import&failonwarnings=true&endpointConfigurationTypes=REGIONAL Host: Content-Type:application/json Content-Length: ... { //OpenAPI definition }