Menu
Amazon API Gateway
Developer Guide

Deploying an API in Amazon API Gateway

After creating your API, you must deploy it to make the API callable for your users. An API deployment represents an API snapshot and becomes callable by the API users when it is associated with a stage. Deploying an API involves creating a deployment and stage and associating the deployment with the stage.

A stage prescribes a unique base URL (of the https://{restapi-id}.execute-api.{region}amazonaws.com/{stageName} format) for your users to call the associated API snapshot. Using different stage-deployment combinations, you can enable smooth and robust version control for the API.

For each stage, you can optimize the API performance by adjusting the default account-level request throttling limits and enabling API caching. You can also enable logging API calls to CloudTrail or CloudWatch and select a client certificate for the backend to authenticate the API requests. In addition, you can override stage-level settings for individual methods, define stage variables to pass stage-specific environment contexts to the API integration at run time. At an API stage, you can export the API definitions and generate an SDK for your users to call the API using a supported programming language.

Every time you update an API or its stage settings, you must redeploy the API by creating new snapshot of the API and associating the new deployment with a new or existing stage to make the changes available for your users.

To make an API's default base URL more user-friendly, you can create a custom domain name (e.g., myapi.mydomain.com) to replace the default host name of the API. With the custom domain name example, the API's base URL becomes https://myapi.mydomain.com/stage.

In this section, we discuss how to perform these deployment-related tasks, using the API Gateway console or calling the API Gateway REST API. To use other tools to do the same, see the documentation of, for example, AWS CLI or an AWS SDK.

To monetize your API deployment, you can leverage the API Gateway integration with AWS Marketplace to vend your API as a Software as a Service (SaaS) product. The instructions are also included in this chapter.