Created
June 1, 2019 23:52
-
-
Save kamataryo/326af191b043df9cf04940419ac46da4 to your computer and use it in GitHub Desktop.
Lambda をデプロイする AWS CLI のスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZIP_FILENAME="./archive-$npm_package_version.zip" | |
rm -rf node_modules | |
npm install --only=prod | |
zip -r $ZIP_FILENAME node_modules index.js | |
aws lambda create-function \ | |
--function-name $AWS_LAMBDA_FUNCTION_NAME \ | |
--runtime nodejs10.x \ | |
--role $AWS_LAMBDA_ROLE \ | |
--handler index.handler \ | |
--zip-file "fileb://$ZIP_FILENAME" \ | |
--environment ABC=abc \ | |
--publish | |
create-event-source-mapping \ | |
--event-source-arn $AWS_CLOUDWATCH_EVENTS \ | |
--function-name $AWS_LAMBDA_FUNCTION_NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment