-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun-scripts.sh
executable file
·147 lines (134 loc) · 2.58 KB
/
run-scripts.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/bin/bash
cd scripts/ || {
echo "Error moving to the 'scripts' directory."
exit 1
}
function create_dynamodb_table() {
echo ""
sh ./1_create-dynamodb-table.sh
echo "DONE!"
}
function create_aurora_postgres_db() {
echo ""
sh ./2_create-aws-aurora-postgres-db.sh
echo "DONE!"
}
function quarkus_native_container_image() {
echo ""
sh ./3_build-and-run-quarkus-local-native-container.sh
echo "DONE!"
}
function push_quarkus_native_image_to_ecr() {
echo ""
sh ./4_push-quarkus-native-image-to-ecr.sh
echo "DONE!"
}
function timer_services_required_iam_resources() {
echo ""
sh ./5_create-timer-service-iam-roles-and-policies.sh
echo "DONE!"
}
function ecs_required_iam_resources() {
echo ""
sh ./6_create-ecs-task-iam-roles-and-policies.sh
echo "DONE!"
}
function create-ecs-cluster-and-log-group() {
echo ""
sh ./7_create-ecs-cluster-and-log-group.sh
echo "DONE!"
}
function create-ecs-task-and-deploy-service() {
echo ""
sh ./8_create-ecs-task-and-deploy-service.sh
echo "DONE!"
}
function deploy_all_resources() {
echo ""
sh ./9_deploy-all-resources-to-aws.sh
}
function delete_all_resources() {
echo ""
sh ./10_delete-all-resources-from-aws.sh
}
# Main Menu
menu() {
echo -ne "
*********************
***** Main Menu *****
*********************
1) Create Task table on DynamoDB.
2) Create Postgres database on Aurora Serverless.
3) Build and run Timer Service as Quarkus native image container.
4) Push the Timer Service image to AWS ECR.
5) Create Timer Service required IAM policies and roles.
6) Create ECS Service required IAM policies and roles.
7) Create ECS Cluster and Log Group.
8) Create ECS Task and deploy the Timer Service.
9) Deploy ALL resources on AWS ECS.
d) DELETE all resources from AWS.
q) Quit/Exit.
"
read -r -p 'Choose an option: ' option
case $option in
1)
create_dynamodb_table
clear
menu
;;
2)
create_aurora_postgres_db
clear
menu
;;
3)
quarkus_native_container_image
clear
menu
;;
4)
push_quarkus_native_image_to_ecr
clear
menu
;;
5)
timer_services_required_iam_resources
clear
menu
;;
6)
ecs_required_iam_resources
clear
menu
;;
7)
create-ecs-cluster-and-log-group
clear
menu
;;
8)
create-ecs-task-and-deploy-service
clear
menu
;;
9)
deploy_all_resources
clear
menu
;;
d)
delete_all_resources
clear
menu
;;
q)
exit 0 ;;
*)
echo -e 'Wrong option.'
clear
menu
;;
esac
}
# Call the menu function
menu