-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup-n.sh
executable file
·39 lines (26 loc) · 1.1 KB
/
setup-n.sh
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
36
37
38
39
#!/bin/bash
#FIXME error- and retry logic - until then, execute this step-by-step
PREFIX=$1
STACK_PREFIX="helloworld-$PREFIX"
SOURCE_PREFIX=$2
echo Environment: $PREFIX based on $SOURCE_PREFIX
echo Create Security Groups Stack
./create-stack-securitygroups.sh $PREFIX
echo Wait for Security Groups Stack
aws cloudformation wait stack-create-complete --stack-name $STACK_PREFIX-sg
DB_PASSWORD_PARAM_NAME=$STACK_PREFIX-db-pwd
echo Create Database Password in SSM: $DB_PASSWORD_PARAM_NAME
./genetare-random-ssm-parameterstore-securestring.sh $DB_PASSWORD_PARAM_NAME
echo Create Database Stack
./create-stack-database.sh $PREFIX
echo Create Load Balancer Stack
./create-stack-applicationloadbalancer.sh $PREFIX
echo Wait for Load Balancer Stack
aws cloudformation wait stack-create-complete --stack-name $STACK_PREFIX-alb
echo Wait for Database Stack
aws cloudformation wait stack-create-complete --stack-name $STACK_PREFIX-rds
echo Create Fargate Stack
./create-stack-fargate-n.sh $PREFIX $SOURCE_PREFIX
echo Wait for Fargate Stack
aws cloudformation wait stack-create-complete --stack-name $STACK_PREFIX-ecs
echo Done