-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathupload_lambda.sh
More file actions
executable file
·33 lines (26 loc) · 931 Bytes
/
upload_lambda.sh
File metadata and controls
executable file
·33 lines (26 loc) · 931 Bytes
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
#!/bin/bash
set -e
if [ -z "$REGION" ]; then
echo "Please define the REGION variable before executing this script."
exit -1
fi
if [ -z "$BUCKET" ]; then
echo "Please define the BUCKET variable before executing this script."
exit -1
fi
if [ -z "$PROFILE" ]; then
echo "Please define the PROFILE variable before executing this script."
exit -1
fi
# Install dependancies locally, so they get included in the zip file
pip install -r requirements.txt -t lambda
aws cloudformation package --profile ${PROFILE}\
--template-file cloudformation.yaml \
--output-template-file generated-cloudformation.yaml \
--s3-bucket ${BUCKET}
aws cloudformation deploy --profile ${PROFILE}\
--template-file generated-cloudformation.yaml \
--stack-name "aws-backup-lambda" \
--region ${REGION} \
--capabilities CAPABILITY_IAM \
--parameter-overrides SuccessSNSTopicOption= ErrorSNSTopicOption=CreateSNS