How do I setup my serverless.yml to deploy to different APIs depending on the stage?
Basically I want this…
https://xyz67890.execute-api.us-east-1.amazonaws.com/dev
https://efg45678.execute-api.us-east-1.amazonaws.com/staging
https://abc12345.execute-api.us-east-1.amazonaws.com/prod
Not this…
https://abc12345.execute-api.us-east-1.amazonaws.com/dev
https://abc12345.execute-api.us-east-1.amazonaws.com/staging
https://abc12345.execute-api.us-east-1.amazonaws.com/prod
The reason is when I deploy a new stage, the previous stage is replaced. For example, if the API DEV is currently deployed, when I deploy STAGING, DEV is replaced and I can’t access it anymore. Although, I can access STAGING now. I need to always have access to each stage. Perhaps I need a different solution?
I’m specifically looking at the “Separate APIs for each stage” section of the following guide: https://serverless-stack.com/chapters/stages-in-serverless-framework.html