Menu
Amazon API Gateway
Developer Guide

Deploy API from the API Gateway Console

You must have created an API before deploying it for the first time. For more information see Creating an API.

Deploy an API to a Stage

The API Gateway console lets you deploy an API by creating a deployment and associating it with a new or existing stage.

Note

To associate a stage in API Gateway with a different deployment, see Associate a Stage with a Different Deployment instead.

  1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway.

  2. In the APIs navigation pane, choose the API you want to deploy.

  3. In the Resources navigation pane, choose Actions.

  4. From the Actions drop-down menu, choose Deploy API.

  5. In the Deploy API dialog, choose an entry from the Deployment stage dropdown list.

  6. If you choose [New Stage], type a name in Stage name and optionally provide a description for the stage and deployment in Stage description and Deployment description. If you choose an existing stage, you may want to provide a description of the new deployment in Deployment description.

  7. Choose Deploy to deploy the API to the specified stage with default stage settings.

Update the Stage Configuration of a Deployment

After an API is deployed, you can modify the stage settings to enable or disable API cache, logging, or request throttling. You can also choose a client certificate for the backend to authenticate API Gateway and set stage variables to pass deployment context to the API integration at run time. For more information, see Update Stage Settings.

Note

If the updated settings, such as enabling logging, requires a new IAM role, you can add the required IAM role without redeploying the API. However, it can take a few minutes before the new IAM role takes effect. Before that happens, traces of your API calls will not be logged even if you have enabled the logging option.

Set Stage Variables for the Deployment

For a deployment, you can set or modify stage variables to pass deployment-specific data to the API integration at run time. You can do this on the Stage Variables tab in the Stage Editor. For more information, see instructions in Set up Stage Variable for API Deployment.

Associate a Stage with a Different Deployment

Because a deployment represents an API snapshot and a stage defines a path into a snapshot, you can choose different deployment-stage combinations to control how users call into different versions of the API. This is useful, for example, when you want to roll back API state to a previous deployment or to merge a 'private branch' of the API into the public one.

The following procedure shows how to do this using the Stage Editor in the API Gateway console. It is assumed that you must have deployed an API more than once.

  1. If not already in Stage Editor, choose the stage you want to update the deployment from an API's Stages option in the APIs main navigation pane.

  2. On the Deployment History tab, choose the option button next to the deployment you want the stage to use.

  3. Choose Change Deployment.