Closed SalmaanP closed 5 years ago
This was already done a while back: https://github.com/lambci/docker-lambda/commit/e2c23e6d10f6ff423611650cf235340f4d1f9adf
The blog post you linked to is talking about this repo:
We’re providing an update to the AWS SAM CLI to enable you to test your functions locally against this new execution environment. The AWS SAM CLI uses a Docker image that mirrors the live Lambda environment locally wherever you do development.
That's this image 😄
oh I see, this is my first lambda function so I am still exploring a lot of new things. do you mind if I ask you a question here? How do I use AWS SAM CLI to build my dependencies, test the handler and then create a zip to upload.
Right now I have this docker file which does all this
FROM lambci/lambda:build-python2.7
COPY . .
RUN mkdir package && cd package && \
pip install rsa --target . && \
zip -r9 ../function.zip . && \
cd ../ && \
zip -g function.zip lambda_function.py
CMD aws lambda update-function-code --function-name test --zip-file fileb://function.zip
Do you think this is a standard way, and then how do I test the function with the dependencies.
Lambda execution environment is being updated as per this blogpost.