What is a "stage" in the context of amazon api gateway?

american-ninja-warrior picture american-ninja-warrior · Dec 16, 2017 · Viewed 7.6k times · Source

What is a "stage" in the context of amazon api gateway. What is it's purpose and how many are meant to be created.

Is there any relation to "staging" in the production/staging/development convention.

Answer

Avichal Badaya picture Avichal Badaya · Dec 16, 2017

I would consider API Gateway stages as different stages in your pipeline or different environments of your stack for the same application. You can have as many stages as you want. In a simple stack, we can think of 3 stages: dev, qa and prod. Few things which you can do with stages:

  1. You will have different URL's for each stage. like https://api-gateway-domain/dev/... , https://api-gateway-domain/qa/..,https://api-gateway-domain/prod/... Basically the URL would be https://api-gateway-domain/<stage_name>/...
  2. You can go with custom domain names to associate with each stage.
  3. You can associate different usage plans for each stage.
  4. You will mostly have at least 1 stage variable to define your stage uniquely. This could be an Elastic Beanstalk URL which is different for each environment. Through stage variables, you will be calling different backend URL's for each stage.
  5. You can deploy different versions of API Gateway configurations for that application to different stages.