Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a new deploy is performed the previous lambda version is deleted #122

Closed
pedrobento988 opened this issue May 11, 2018 · 2 comments
Closed

Comments

@pedrobento988
Copy link

pedrobento988 commented May 11, 2018

When a new deploy is made at vanilla Serverless version (no plugins), the default behavior is to skip delete previous lambda versions, i.e., on the generated CF template, the AWS::Lambda::Version resource's DeletionPolicy is set to "Retain".

However when using this plugin that policy changes to "Delete" and lambda versions that do not have an alias are deleted, as per this policy:
https://github.com/HyperBrain/serverless-aws-alias/blob/6b9d0ac66a71dd686627eefccf071e0ea7e266ee/lib/stackops/functions.js#L113

Is this intended? Is there anyway to keep the lambda versions?

@HyperBrain
Copy link
Member

@pedrobento988 This is intended, because if you let the service have retained versions, you cannot tell anymore, which alias it came from. I.e. if you deploy multiple aliases with different artifacts and configurations into the same stage, you could not just tag any retained version and expect that it was from the expected alias.

The only versions that are intentionally retained are the ones deployed by serverless deploy function because they are not controlled by CloudFormation and (by design) function deploy is intended for debugging only, so in that case you actually know where the version came from and when to delete it.

@pedrobento988
Copy link
Author

Thank you for your confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants