serverless-application-model
serverless-application-model copied to clipboard
Add policy item of retaining only specified latest versions of lambdas
Describe your idea/feature/enhancement
- the SAM template should have an item policy on how many versions of the lambda should be retained (last versions). Could be further feature rich like keeping only specific versions.
Proposal
- Adding section in the
Resources
should be appropriate way to go imho. Something like:
Resources:
RetainVersions:4
Additional Details
This would help save a lot space for large companies who does not use some abstraction on top of lambdas.
@zafarella Thanks for the request. Since this is Spec specific, I am going to forward this to that repo.
@zafarella Thanks a lot for the suggestion! We'll pass this along for prioritization. However, I wanted to let you know that there's an app called lambda-janitor in the AWS Serverless Application Repository that can be deployed into your account with just a few clicks and will automatically clean up old Lambda function versions. One advantage to using this app is that it cleans up all Lambda functions within the account/region it's deployed to, so you don't need to set a RetainVersions
value on every function you define.