Propagate same version to dev/uat/prod

What would be best way to handle propagation of the same code to dev, uat and prod environments. Considering we could have different accounts per environment.
How do you ensure the same version goes to prod after you tested in uat?

1 Like

+1 I have the same question. It seems that serverless does not utilize the “parameters” section of Cloudformation templates, allowing reusability. This reusability gives operators

  1. confidence that exact same code from a test environment is used in prod
  2. no need to know additional tooling (e.g. node/serverless) in addition to AWS CLI / Cloudformation
  3. speed of deployment (build & tests do not need to be run again)

Looks like there might be some means of just creating artifacts locally but then you need to build your own tooling to push to S3 / manage S3 links between lambda ZIP code and templates.

The newly introduced AWS SAM sort of supports this model of packaging and deploying as being two different steps giving the ability to deploy same package in multiple accounts and/or regions.

With SAM:

In order to deploy your application, the first step is to package it which creates the deployment zip , uploads it to the S3 bucket that you specified and converts your original template to include the code uri that points to the deployment zip.

aws cloudformation package
–template-file example.yaml
–output-template-file serverless-output.yaml
–s3-bucket s3-bucket-name

You can then run the deploy as following

aws cloudformation deploy
–template-file serverless-output.yaml
–stack-name new-stack-name
–capabilities CAPABILITY_IAM

Since the second command is normal cloudformation deploy, we can use parameters with [–parameter-overrides […]]

It would be nice if Serverless supported the same as well.

1 Like

We’ve been discussing these changes on this GH issue feel free to chime in!

Personally I’d use version control (i.e git) to handle this. Just use tags and branches like you would with any other code base.