-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-stack.sh
More file actions
35 lines (30 loc) · 934 Bytes
/
create-stack.sh
File metadata and controls
35 lines (30 loc) · 934 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
34
35
#!/bin/bash
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-s|--stack-name)
STACK_NAME="$2"
shift
shift
;;
-b|--bucket-name)
BUCKET_NAME="$2"
shift
shift
;;
*)
POSITIONAL+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL[@]}"
aws cloudformation create-stack --stack-name $STACK_NAME --template-body file://bucket.yaml --capabilities CAPABILITY_IAM \
--parameters ParameterKey=BucketName,ParameterValue=$BUCKET_NAME
aws cloudformation wait stack-create-complete --stack-name $STACK_NAME
./deploy-lambda-to-bucket.sh --name ExampleFunction --location example-lambda --bucket-name $BUCKET_NAME
aws cloudformation update-stack --stack-name $STACK_NAME --template-body file://lambda.yaml --capabilities CAPABILITY_IAM \
--parameters ParameterKey=BucketName,ParameterValue=$BUCKET_NAME
aws cloudformation wait stack-update-complete --stack-name $STACK_NAME