You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When updating the code for a layer that a lambda in the same stack uses, a new layer version is updated, and the $LATEST lambda version is updated, but no new lambda numeric version is created that points to the new layer version.
It appears this is very similar to this previous issue: #4510
Every deploys "successfully" but when the versioned lambda stack output arn is referenced the version is unchanged and therefore still points to an old layer.
My guess is that looking at https://github.com/serverless/serverless/blob/master/lib/plugins/aws/package/compile/functions/index.js#L434 and the PR mentioned above the lambda version logical id is generated using the lambda source and the lambda config data. However, when using layers as described in the documentation (see example below) the layer is just a string ref to another cloudformation resource and therefore will not change unless the layer resource name is changed.
If this is a bug rather than just misunderstanding of how layers within the same stack should be used, then I will submit a PR that includes the timestamped lambda layer zip S3 path so that the logical id will change each time a new layer zip is uploaded, similar to how #4510 was handled.
The text was updated successfully, but these errors were encountered:
Description
When updating the code for a layer that a lambda in the same stack uses, a new layer version is updated, and the $LATEST lambda version is updated, but no new lambda numeric version is created that points to the new layer version.
It appears this is very similar to this previous issue: #4510
Every deploys "successfully" but when the versioned lambda stack output arn is referenced the version is unchanged and therefore still points to an old layer.
My guess is that looking at https://github.com/serverless/serverless/blob/master/lib/plugins/aws/package/compile/functions/index.js#L434 and the PR mentioned above the lambda version logical id is generated using the lambda source and the lambda config data. However, when using layers as described in the documentation (see example below) the layer is just a string ref to another cloudformation resource and therefore will not change unless the layer resource name is changed.
Example serverless.yml (from documentation)
https://www.serverless.com/framework/docs/providers/aws/guide/layers/
Proposed fix
If this is a bug rather than just misunderstanding of how layers within the same stack should be used, then I will submit a PR that includes the timestamped lambda layer zip S3 path so that the logical id will change each time a new layer zip is uploaded, similar to how #4510 was handled.
The text was updated successfully, but these errors were encountered: