0
votes

To deploy a serverless project into a stage of a service, following command can be used

serverless deploy --stage dev

Extracted from the docs https://serverless.com/framework/docs/providers/aws/guide/deploying/

However when above command is used to deploy a service, it creates a new service with name dev-aws-nodejs in API Gateway.

Is it possible to create a service with name aws-nodejs and have different stages like dev, stag, prod etc.. Therefore, when you run the following command

serverless deploy --stage stag

A new stage called stag will be created under service aws-nodejs.

enter image description here

1

1 Answers

1
votes

By design the current version of serverless framework doesn't support this feature. But the version 0.5.6 had been designed to deploy multiple stages into api single api gateway project. Following open issues are related to this. Some have suggested few workarounds.

AWS API Gateway stages and names are separated

Issue below, mainly highlight different services into same api gateway. But it also has some comments related to your query as well.

Deploy many micro/nano services to one API Gateway

Update:

In the recent release of serverless (v1.19), they have mentioned that they have started working on a solution for this.

Serverless v1.19 Changelog