-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (30 loc) · 992 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
STACKNAME_BASE="aws-apigw-acm-reference"
REGION="us-west-1"
URL="aws-apigw-acm.jolexa.us"
ZONE="jolexa.us."
BUCKET="aws-apigw-acm-reference"
all: deploy-apigw
prep:
cd lambda && \
zip -r9 /tmp/zipfile.zip * && \
aws s3 cp --region $(REGION) --acl public-read /tmp/zipfile.zip \
s3://$(BUCKET)/$(shell md5sum lambda/* | md5sum | cut -d ' ' -f 1) && \
rm -f /tmp/zipfile.zip
deploy-apigw: deploy-acm prep
aws cloudformation deploy \
--template-file apigw-lambdas.yml \
--stack-name $(STACKNAME_BASE) \
--region $(REGION) \
--parameter-overrides "DomainName=$(URL)" \
"ZoneName=$(ZONE)" \
"Bucket=$(BUCKET)" \
"md5=$(shell md5sum lambda/* | md5sum | cut -d ' ' -f 1)" \
--capabilities CAPABILITY_IAM || exit 0
deploy-acm:
# Only works in us-east-1
aws cloudformation deploy \
--template-file acm_certs.yml \
--stack-name $(STACKNAME_BASE)-acm-certs \
--region us-east-1 \
--parameter-overrides "ACMUrl=$(URL)" \
--capabilities CAPABILITY_IAM || exit 0