What is a "stage" in the context of Amazon API Gateway? What is it's purpose and how to create one?
Is there any relation to "staging" in the production/staging/development convention?
An API stage is a logical reference to a lifecycle state of your API (for example, dev , prod , beta , or v2 ). API stages are identified by their API ID and stage name, and they're included in the URL you use to invoke the API.
To declare stage variables using the API Gateway consoleCreate an API, create a GET method on the API's root resource, if you have not already done so. Set the HTTP Endpoint URL value as " http://${stageVariables.url} ", and then choose Save. Choose Deploy API. Choose New Stage and enter " beta " for Stage name.
Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. APIs act as the "front door" for applications to access data, business logic, or functionality from your backend services.
Although you can use Stages as part of a different stages in your pipeline or environments this goes against AWS best practice for managing environments.
If you want a development environment, then create a development user/account and deploy using that. Likewise other environments like Production or Pre-Production.
I also wouldn't want to use Stages for versioning my APIs. (As versioning REST APIs is a huge anti-pattern)
Which does then beg the question about what Stages actually are in AWS gateways used for? Whenever i've used them I've out a sensible placeholder there.
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:
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>/..
. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With