-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (31 loc) · 1.02 KB
/
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
35
FUNCTION_NAME=RSSReader
STACK_NAME=Lambda$(FUNCTION_NAME)
.PHONY: zip
zip: clean
@pip3 install --upgrade feedparser -t . > /dev/null
@zip -r function lambda_function.py sgmllib.py event.json feedparser > /dev/null
.PHONY: clean
clean:
@rm -f function.zip
.PHONY: create
create: zip
unset AWS_DEFAULT_REGION; \
aws cloudformation create-stack \
--stack-name $(STACK_NAME) \
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM \
--template-body file://lambda.yml \
--tags Key=Name,Value=$(FUNCTION_NAME) && sleep 61; \
aws lambda update-function-code \
--function-name $(FUNCTION_NAME) \
--zip-file fileb://function.zip;
.PHONY: update
update: zip
unset AWS_DEFAULT_REGION; \
aws cloudformation update-stack \
--stack-name $(STACK_NAME) \
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM\
--template-body file://lambda.yml \
--tags Key=Name,Value=$(FUNCTION_NAME); \
aws lambda update-function-code \
--function-name $(FUNCTION_NAME) \
--zip-file fileb://function.zip;