How to deploy a specific stage in Serverless

Set the stage in your serverless.yml or using the --stage or -s option when calling sls deploy in Terminal. i.e. sls deploy -s dev or sls deploy -s uat.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 12/17/2022 at 16:48
Last Updated on 12/17/2022 at 17:03
Three flowers that represent AWS Lambda, Typescript & Serverless side by side. Beneath it sits the text "Deploy Stage."

Set the stage in your serverless.yml or using the --stage or -s option when calling sls deploy in Terminal. i.e. sls deploy -s dev or sls deploy -s uat.

According to the Serverless documentation, you can either set the stage in your serverless.yml or set it as an option when deploying from terminal.

Read Serverless's Deploy Documentation

How to set the stage in Serverless.yml

To set the stage in your serverless.yml, add a stage parameter within your provider as shown in the sample code below and deploy your service.

How to set the stage when deploying

To set the stage when deploying, change STAGE with your chosen stage (i.e. dev, uat or prod) in either of the sample code below

sls deploy --stage STAGE

Or

sls deploy -s STAGE

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.

SubscribeInquireView All PostsView All ServicesView All Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe