question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration of AWS function version backlog (version history)

See original GitHub issue

This is a Feature Proposal

Description

Currently the function versions deployed by Serverless will be retained forever. For some use cases it is good to have some old versions available (e.g. blue/green deplyoment), but keeping every version will clutter the version history.

As there are as many different uses as there are different users, it would be great if the version backlog could be configured at everyone’s will. Currently the versioning can only be disabled completely by setting versionFunctions to false.

This discussion originated in Gitter, so I’ll put the snippets together, that should compose a good starting point for a discussion or even provides a feasible solution.

Proposal

We could extend the semantics of the versionFunctions property and add an additional property to specify the size of the version backlog (in case the user wants to keep versions).

versionFunctions: false | 'delete' | 'retain'
retainVersions: number (defaults to all)

The versionFunctions values would mean the following: false: Disable versioning, exactly the same as now when set to false delete: Delete old versions (tech. set DeletionPolicy to Delete in the CF AWS::Lambda::Version resource). CF manages the deletion. retain: Retain old versions (tech. set DeletionPolicy to Retain as it is now). SLS manages the version retention. If the retainVersions property is set to a positive integer, that amount of old versions will be kept. If not set, no versions will be deleted at all.

retain must be the default if not specified, because that matches the current behavior and won’t lead to breaking changes.

Samples

Retain the 5 last versions:

versionFunctions: 'retain'
retainVersions: 5

Keep no versions:

versionFunctions: 'delete'

Keep all versions:

<nothing set> (backwards compatible)
or (explicitly)
versionFunctions: 'retain'

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:8
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
FilipPyrekcommented, Feb 1, 2019

Thanks, I know about that plugin. I mean - if there is already implemented versionFunctions inside Serverless, why not retainVersions

0reactions
medikoocommented, Nov 24, 2020

I really like the proposal. If there’s an interest, it’ll be great to start with implementation spec (proposal on how to implement this feature internally). Having and agreeing on that PR would be welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lambda function versions - AWS Documentation
Open the Functions page of the Lambda console. · Choose a function and then choose Versions. · On the versions configuration page, choose...
Read more >
AWS::Lambda::Version - AWS CloudFormation
The AWS::Lambda::Version resource creates a version from the current code and configuration of a function. Use versions to create a snapshot of your ......
Read more >
AWS Support – Knowledge Center
Learn about some of the most frequent questions and requests that we receive from AWS Customers including best practices, guidance, and troubleshooting ...
Read more >
AWS Snowball FAQs | Amazon Web Services
AWS Snowball FAQs to learn more about key features, security, billing, transfer protocols, and general usage.
Read more >
list-versions-by-function — AWS CLI 1.27.37 Command ...
Description¶. Returns a list of versions , with the version-specific configuration of each. Lambda returns up to 50 versions per call. See also: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found