Skip to content

Instantly share code, notes, and snippets.

@nmnp
Last active February 4, 2021 10:17
Show Gist options
  • Save nmnp/c4ac1f85196982b09d840f7199b64a7f to your computer and use it in GitHub Desktop.
Save nmnp/c4ac1f85196982b09d840f7199b64a7f to your computer and use it in GitHub Desktop.
aws/awslocal cli commands
# create function
# without environment variables
awslocal --endpoint-url=http://localhost:4574 lambda create-function --function-name=f1 --runtime=python3.6 --role=r1 --handler=coupon.handler --zip-file fileb://deployment_bundle.zip
#with environment varibles
awslocal --endpoint-url=http://localhost:4574 lambda create-function --function-name=f1 --runtime=python3.6 --role=r1 --handler=coupon.handler --zip-file fileb://deployment_bundle.zip --environment Variables='{HOST=localhost, USERNAME=root, PASSWORD=promoms, DATABASE=promoms, PORT=3306, REDIS_HOST=localhost, REDIS_PORT=6379, APP_NAME=promoms, APP_ENV=dev, PROMOTIONS_COUPONS_CACHE_KEY=promoms:coupons}'
# invoke function
awslocal lambda --endpoint-url=http://localhost:4574 invoke --function-name f1 --payload '{"coupon":"default"}' result.log
# delete function
awslocal lambda --endpoint-url=http://localhost:4574 delete-function --function-name f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment