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.

Lambda layer versions are not being retained

See original GitHub issue

Bug Report

Description

  1. What did you do? Deployed a layer-only service with retain: true
  2. What happened? Previous layer version is deleted
  3. What should’ve happened? Since retain is set to true, the previous layer version should still be available
  4. What’s the content of your serverless.yml file?
service: config-layer
provider:
  name: aws
  profile: personal
layers:
  config:
    path: ./
    retain: true
    compatibleRuntimes:
      - nodejs10.x
  1. What’s the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy) debug.txt

Similar or dependent issues:

In PR #6545, S3 key was removed from the sha hash, which results in the same logical id with every deployment. I believe cloudformation removes versions with the same logical id, regardless of DeletionPolicy: Retain being set.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:19
  • Comments:29 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
palafoxernestocommented, Nov 12, 2019

I’m interested too, what are next steps on this?

6reactions
danielstandbycommented, Oct 7, 2019

Any news on this one?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::Serverless::LayerVersion
Specifies whether old versions of your LayerVersion are retained or deleted after an update.
Read more >
Are old AWS Lambda layers automatically removed? If not ...
Old layers are not automatically deleted. You can run a CLI command such as the following to delete a layer version: $ aws...
Read more >
AWS Lambda Layers - Serverless Framework
All of the Lambda layers in your serverless service can be found in serverless.yml under ... If true, layer versions are not deleted...
Read more >
Fun with AWS Lambda Layers and Serverless - Medium
It turns out, Serverless by default do not retain versions of your Lambda layers, this setting is set to false. See the Serverless...
Read more >
Lambda::LayerVersion: how to retain layer versions? : r/aws
If you want to create a new version, you should add they key value pair "RetentionPolicy: Retain" to your layer in the AWS...
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