Lambda layer updating when there were no changes
See original GitHub issueWhy does chalice with automatic_layer
have to update the lambda layers every time you call deploy? If it knows to use the same deployment package, shouldn’t it know it doesn’t need to update the layer? This method doesn’t really save time like it says in the documentation, because the dependencies are still getting re-deployed.
Example where I run deploy
twice:
$ chalice deploy
Creating shared layer deployment package.
Creating app deployment package.
Creating lambda layer: webstack-dev-managed-layer
...
$ chalice deploy
Creating shared layer deployment package.
Reusing existing shared layer deployment package.
Creating app deployment package.
Reusing existing app deployment package.
Updating lambda layer: webstack-dev-managed-layer
...
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Using layers with your Lambda function - AWS Documentation
A Lambda layer is a .zip file archive that can contain additional code or other content ... You cannot update functions' layer versions...
Read more >Calculating when Lambda Layers should be updated
Look at your git file changes (i.e. with PythonGit) and see if any of your layers have changed files. If so, you should...
Read more >Updating AWS Lambda Function Code when Local Files ...
Updating AWS Lambda Function Code when Local Files Change · 1. Create a Makefile · 2. Publish a New Layer Version when Dependencies...
Read more >Migration & Backwards Compatibility - Lambda layer behavior ...
Any update to an existing Lambda layer triggers a migration for that layer upon amplify push . Once the layers are migrated, the...
Read more >terraform-aws-modules/lambda/aws
Create, update, and publish AWS Lambda Function and Lambda Layer - see ... During the plan phase, when using docker, there is no...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also I believe this breaks the shared layers concept outlined in the AWS blog post here.
IE, trying to set a fixed shared layer like so:
Will break upon two subsequent deployments of the same
requirements.txt
, even though the actual requirements don’t change. Since the:version
number will get bumped and the previous version deleted, all of the layer sharing will break, even though the actual layer contents haven’t been modified, so you can’t really point to an 100% known fixed shared layer which you know contains these exact package versions and these versions only, since the version number isn’t fixed.Yeah, it seems like that’s an optimization we should be able to make. The main benefits you get now are 1) skipping the pip download process and 2) sharing the layer across multiple lambda functions, but if you just have a single lambda function it really only saves time by skipping the pip download process.