SAM Build Not Mounting Lambda Code in /var/task
During sam local start api
on Windows
#7478
Labels
area/docker
blocked/more-info-needed
More info is needed from the requester. If no response in 14 days, it will become stale.
platform/windows
Description:
When using
sam build
and runningsam local start api
orsam local invoke
, SAM builds the Lambda image on the fly. However, it seems that the Lambda code is not being mounted correctly in/var/task
, which results in an empty directory. This prevents the Lambda from executing properly.Context:
I expect SAM to mount the built Lambda sources from
dist/
into/var/task
inside the container. However, the/var/task
directory is empty, making it impossible to execute the Lambda function viasam local start api
.I've tried multiple solutions but couldn't resolve this issue. It might be related to switching from a Linux development environment to a Windows environment.
In my
template.yml
, I point theCodeUri
to the compiled code in thedist/
directory, like this:Expected behavior:
The compiled Lambda code should be mounted into
/var/task
inside the container to allow the Lambda function to execute properly.Environment:
template.yml
Steps to reproduce:
sam build
.sam local start api
orsam local invoke
./var/task
is empty.Possible suggestions or fixes:
/var/task
directory during execution on Windows.Thank you for your help!
The text was updated successfully, but these errors were encountered: