Amazon API Gateway
Developer Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Import an Edge-Optimized API into API Gateway

You can import an API's OpenAPI definition file to create a new edge-optimized API by specifying the EDGE endpoint type as an additional input, besides the OpenAPI file, to the import operation. You can do so using the API Gateway console, AWS CLI, or an AWS SDK.

For a tutorial on using the Import API feature from the API Gateway console, see TUTORIAL: Create a REST API by Importing an Example.

Import an Edge-Optimized API Using the API Gateway Console

To import an edge-optimized API 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 Edge optimized.

  5. Choose Import to start importing the OpenAPI definitions.

Import an Edge-Optimized API Using the AWS CLI

To import an API from an OpenAPI definition file to create a new edge-optimized API using the AWS CLI, use the import-rest-api command as follows:

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

or with an explicit specification of the endpointConfigurationTypes query string parameter to EDGE:

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