I'm trying to get a local env to run/debug Python Lambdas with VSCode (windows). I'm using a provided HelloWorld example to get the hang of this but I'm not being able to invoke.
Steps used to setup SAM and invoke the Lambda:
- I have Docker installed and running
- I have installed the SAM CLI
- My AWS credentials are in place and working
- I have no connectivity issues and I'm able to connect to AWS normally
- I create the SAM application (HelloWorld) with all the files and resources, I didn't change anything.
- I run "sam build" and it finishes sucessfully
- I run "sam local invoke" and it fails with timeout. I increased the timeout to 10s, still times out. The HelloWorld Lambda code only prints and does nothing else, so I'm guessing the code isn't the problem, but something else relating to the container or the SAM env itself.
C:\xxxxxxx\lambda-python3.8>sam build Your template contains a resource with logical ID "ServerlessRestApi", which is a reserved logical ID in AWS SAM. It could result in unexpected behaviors and is not recommended.
Building codeuri: C:\xxxxxxx\lambda-python3.8\hello_world runtime: python3.8 metadata: {} architecture: x86_64 functions: ['HelloWorldFunction'] Running PythonPipBuilder:ResolveDependencies Running PythonPipBuilder:CopySource
Build Succeeded
Built Artifacts : .aws-sam\build Built Template : .aws-sam\build\template.yaml
C:\xxxxxxx\lambda-python3.8>sam local invoke Invoking app.lambda_handler (python3.8) Skip pulling image and use local one: public.ecr.aws/sam/emulation-python3.8:rapid-1.51.0-x86_64.
Mounting C:\xxxxxxx\lambda-python3.8.aws-sam\build\HelloWorldFunction as /var/task:ro,delegated inside runtime container Function
'HelloWorldFunction' timed out after 10 seconds
No response from invoke container for HelloWorldFunction
Any hints on what's missing here?
Thanks.