Lambda layer code not updated in Lambda function during sam sync
#3632
Labels
stage/needs-triage
Automatically applied to new issues and PRs, indicating they haven't been looked at.
Description
When using
sam sync
for updating a Lambda Layer written in typescript, the change is not reflected in the imported code in the lambda function.Referencing a LambdaLayer in a Lambda function, I'm expecting the lambda function to use the updated layer during invocation. This is the observed bahaviour using python, but when using a Typescript layer together with
sam sync
, the change is not propagated to the live function, despite the SAM cli feedback indicating it has:SAM template:
Steps to reproduce
(If you don't want to set it up from scratch, you can clone this repo, where I've done the below steps)
sam init
with a typescript hello world example.npm install
inside the hello-world function diretory to install esbuildsam build --build-in-source && sam deploy
in the rootsam sync --code --watch --build-in-source
in the root.If we now make an update to the lambda function, the correct and latest layer code is used.
Observed result
Updating the Lambda layer, SAM cli syncs the layer and reports that the sync was sucessfull. Inspecting the Lambda function in the console, I also see that the layer version has been bumped. Invoking the lambda function, however, is using the old layer code.
Expected result
The latest layer code to be used.
Additional environment details
sam --version
: 1.108.0The text was updated successfully, but these errors were encountered: