this is a repo for building Python functions from Zero
-
Create scaffold:
Makefile
,requirements.txt
,hello.py
-
Create a virtualenv:
virtualenv ~/.python-functions-zero
-
Source it:
source ~/.python-functions-zero/bin/activate
./cli.py --color "red"
make lint && make test
You can read this sample project
docker build --tag=cli-aws .
docker run -it cli-aws python cli.py --color "Red"
docker pull noahgift/cli-aws
def lambda_handler(event, context):
print(f"This is the event {event}")
if event["name"] == "Marco":
return "Polo"
return "No!"
aws lambda invoke --function-name <MyFunction> \ --payload '{"name": "Bob" }' out.txt