Skip to content

Vivicorp-AWS/cdk-lab-lambda-python-layer

Repository files navigation

CDK Lab for Lambda with Python Layer

This lab demonstrates how to include the package from PyPI.

After the creation of Python environment, install (Doc) the package "requests" into Python layer by executing:

pip install --target ./layer/python requests

Then importing requests package will be successful no matter import in handler function (/lambda/index.py) or in module in Python layer (/layer/python/common.py).

After deploying the Lambda function, invoke it from console with anything (the functions in this repo don't parse anything from the event so it's okay to pass anything, even blank data) and get the response.

Or invoke with AWS CLI:

aws lambda invoke \
  --function-name <function-name> \
  -output json \
  /tmp/output.json && cat /tmp/output.json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors