Skip to content

Instantly share code, notes, and snippets.

@matthewp
Created July 7, 2020 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewp/8cae638bb84eb8f17c87c38856d9a17a to your computer and use it in GitHub Desktop.
Save matthewp/8cae638bb84eb8f17c87c38856d9a17a to your computer and use it in GitHub Desktop.
Lambda makefile
aws lambda create-function \
--function-name my-function-name \
--runtime nodejs12.x \
--role arn:aws:iam::..... \
--handler main.handle \
--zip-file fileb://./main.zip
main.zip: main.js package.json package-lock.json src lib node_modules
zip -r $@ $^
clean:
@rm -f main.zip deploy.json
.PHONY: clean
deploy.json: main.zip
aws lambda update-function-code --function-name my-function-name --zip-file fileb://./$^ > $@
deploy: deploy.json
.PHONY: deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment