Skip to content

Rollback and Prune previous versions #316

@zaus

Description

@zaus

Describe the feature

This may be more a pertinent to using SAM template's AutoPublishAlias or SemanticVersion rather than dotnet CLI, but deployment creates several artifacts in the S3 deployment bucket and never removes them. It's not clear how to get back to a previous version (either via CLI or in Console, as no changeset history is listed?), and I've only seen suggestions for manually cleaning up old stuff or awkward lifecycle policies or installing random 1stparty or 3rdparty plugins to do it for you.

The Serverless Framework's prune plugin handles this for the Lambda versioning, and I think it already cleans up old deployment artifacts?

Use Case

  • Clearing old micro-version/minor changes from test attempts
  • Reverting deployment with breaking change

Proposed Solution

Specifying a major/minor version number in template and remembering to update it when you want an explicit version, or deploying with an --autoversion flag; either should save separate changesets (is that how you're supposed to do it with Cloudformation Stacks?). Then:

dotnet lambda rollback-stack --v <EXACT_VERSION_NUMBER>

or

dotnet lambda rollback-stack --v "-<number of versions back"

or

dotnet lambda rollback-stack # just to previous version

To get back to the indicated version.

Also, specifying something like --retainVersions 5 to keep the last 5 deployments for rollback.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Targeted .NET platform

Any

CLI extension version

Package Id Version Commands

amazon.lambda.testtool-3.1 0.10.0 dotnet-lambda-test-tool-3.1
amazon.lambda.tools 5.10.4 dotnet-lambda
dotnet-xscgen 2.0.662 xscgen

Environment details (OS name and version, etc.)

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.lEffort estimation: largemodule/cli-extp3This is a minor priority issuequeued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions