Skip to content

Can deploy-serverless be used to build once, deploy to multiple environments? #236

Answered by normj
lorenh asked this question in Q&A
Discussion options

You must be logged in to vote

Off the top of my head I think what I would do is write the CloudFormation template to have a parameter that controls what stage you want to deploy. You can use the parameter in your template to control what environment variables are set in your function which in your code can control what configurations to load.

Then use dotnet lambda package-ci command to build/package/upload the project and generate a copy of the CloudFormation template with the location of the Lambda function binary updated to the location in S3. Then throughout your pipeline you can use the CLI or whatever tool to deploy/redeploy the CloudFormation template passing in the parameter value for the expected stage.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lorenh
Comment options

Answer selected by ashishdhingra
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
guidance Question that needs advice or information. module/cli-ext
2 participants