Skip to content

Instantly share code, notes, and snippets.

@dave-malone
Created April 16, 2019 14:20
Show Gist options
  • Save dave-malone/55870cbe13e09466713bc0c4b8165b62 to your computer and use it in GitHub Desktop.
Save dave-malone/55870cbe13e09466713bc0c4b8165b62 to your computer and use it in GitHub Desktop.
An example of how to automate Lamba code updates, versions, and aliases
rm hello_world_python_lambda.zip
zip -r hello_world_python_lambda.zip greengrasssdk greengrassHelloWorld.py
update_lambda_result=$(aws lambda update-function-code \
--function-name Greengrass_HelloWorld \
--zip-file fileb://hello_world_python_lambda.zip \
--publish)
latest_lambda_version=$(echo "$update_lambda_result" | jq -r '.Version')
aws lambda update-alias \
--function-name Greengrass_HelloWorld \
--function-version $latest_lambda_version \
--name GG_HelloWorld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment