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.
Topics
Import an edge-optimized API using the API Gateway console
To import an edge-optimized API using the API Gateway console, do the following:
-
Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway
. -
Choose Create API.
-
Under REST API, choose Import.
-
Copy an API's OpenAPI definition and paste it into the code editor, or choose Choose file to load an OpenAPI file from a local drive.
-
For API endpoint type, select Edge-optimized.
-
Choose Create API 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 \ --parameters endpointConfigurationTypes=EDGE \ --fail-on-warnings \ --body 'file://path/to/API_OpenAPI_template.json'