agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 53 forks source link

Bug fix: check for matching layer version, instead of relying on cloudformation version #152

Closed smundro closed 4 months ago

smundro commented 7 months ago

The intent of this plug-in is to prevent recreation of layers when no updates have occurred (by performing the layer creation outside of the CloudFormation stack). The current logic will rely on the current version of the layer in the CloudFormation stack, when there are no changes in the deployment bucket. However, this can result in the use of the wrong layer version if the the deployment bucket is updated separately from the CloudFormation stack (either via a package command, or a failed stack deployment).

This update uses the layer description as a "tag" to identify a layer that matches the current dependencies file checksum (and customHash) to ensure that a compatible layer is selected, if available.

Notes:

bart commented 5 months ago

When will it get merged?

agutoli commented 4 months ago

New release: serverless-layers@2.8.5

agutoli commented 4 months ago

I appreciate your PR, @smundro. Thanks a lot.