-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (28 loc) · 790 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
PROJECT = ElonTweets
FUNCTION = $(PROJECT)
REGION = us-east-1
PROFILE = ask-cli
.phony: clean
clean:
rm -f -r *.zip
build: clean
zip -r $(FUNCTION).zip . -x "*.git*" "img/*" "*.zip" "package*" "test.js" ".vscode/*" ".DS_Store" "Make*"
create: build
aws lambda create-function \
--handler index.handler \
--function-name $(FUNCTION) \
--region $(REGION) \
--zip-file fileb://$(FUNCTION).zip \
--role arn:aws:iam::407197073751:role/lambda_basic_execution \
--runtime nodejs4.3 \
--timeout 120 \
--memory-size 512 \
update: build
aws lambda update-function-code \
--function-name $(FUNCTION) \
--zip-file fileb://$(FUNCTION).zip \
--region $(REGION) \
--publish \
--profile $(PROFILE) \
delete: clean
aws lambda delete-function --function-name $(FUNCTION)