-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: sam sync does not update layer version in dependent lambdas #4077
Comments
Thanks for reporting this in! We will first try to reproduce this issue using information you provided |
@maksymdukov Sorry for a postponed response here, as I look at the issue carefully I wonder if we are missing some logic to create function layer reference syncs when the layer attribute is defined in functions. Can I confirm with you that this only happens when you define the layer reference in globals? Meanwhile we will reproduce the issue and investigate if the get dependent functions method didn't return all functions for your case Below is how we are finding the layer's related functions:
|
Also just assigning myself here to keep track of the issue |
We are also impacted by this issue. The issue happens only when the layer is defined in the Globals section. |
Just ran into this issue as well. Would love any thoughts about timing to resolve. we're thinking about giving up using Globals for this because of how much worse it makes |
Similarly, I am using nested templates where the layers are defined in one template and the functions that use the layers are in a different template. The deployments work correctly, but when I use Here is how I'm currently exporting the layer reference:
Here is how I'm using the layer reference:
|
This still seems to be an issue. |
Description:
sam sync
--watch
and--code
does not syncFunction Layer Reference
under certain conditions when Layer itself gets synced.Steps to reproduce:
Create serverless template yaml and put it in <rootDir>/cf/template.yaml
<rootDir>/src/common/Makefile
<rootDir>/src/common/log.js
<rootDir>/src/handlers/handle.js
From the rooDir run sam sync:
Try to change code in the layer <rootDir>/src/common/log.js
Observed result:
Updated layer gets synced but Lambda's Layer Reference does not get updated, meaning Lambda still points to the old layer version
Expected result:
Lambda's Layer Reference gets updated
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Workaround (1) to make it all work - specify
- !Ref LambdaLayer
in a lambda declaration section instead of the Globals sectionWorkaround (2) - move template.yaml into the root directory.
sam --version
: SAM CLI, version 1.53.0Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: