agutoli / serverless-layers

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

Does not use latest layer if layer was created during build #35

Closed CartierDiamonds closed 4 years ago

CartierDiamonds commented 4 years ago

If you run a serverless build and a new layer is created based on changes in layer dependencies, and then run serverless deploy independently using the package just built, it will say no changes and use the current layer attached to the lambda function. For example, If layer version 1 is currently attached to the lambda function and i change a dependency, i first run serverless package --package package to create the package and version 2 of the layer will be created based on the changed dependencies. When i run serverless deploy --package package it will say 'no changes detected' and keep version 1 attached, even though version 2 was just created in the build step. It looks like in the CloudFormationService.js file, its getting the outputs from cfn, but the cfn isnt updated when i do a sls build

agutoli commented 4 years ago

Hi @CartierDiamonds. What version are you using? Can you share your config, please? (just layers one, not sensible of course).