changed AWS instance size to t2.micro, t2.nano is still possible using install-aws.sh cloud-init script, but really limited in RAM, added support for availability zones and spread instance across different az to improve fault tolerance, select AMI directly, remove 0.0.0.0/0 access to mysql

This commit is contained in:
Sebastian Rieger
2022-05-09 23:43:28 +02:00
parent e18ab4dc70
commit 09c25bf38e
2 changed files with 62 additions and 25 deletions

View File

@ -59,9 +59,10 @@ def main():
token=aws_session_token,
region=region_name)
print("Deleting previously created load balancers in: " + str(elb_conn.list_balancers()))
# print("List of load balancers: " + str(elb_conn.list_balancers()))
for loadbalancer in elb_conn.list_balancers():
if loadbalancer.name == "lb1":
print("Deleting Load Balancer" + str(loadbalancer))
elb_conn.destroy_balancer(loadbalancer)
###########################################################################
@ -101,7 +102,10 @@ def main():
if instance.name in ['all-in-one', 'app-worker-1', 'app-worker-2', 'app-controller', 'app-services']:
if instance.state is not NodeState.TERMINATED:
nodes_still_running = True
print('There are still instances running, waiting for them to be destroyed...')
if nodes_still_running is True:
print('There are still instances running, waiting for them to be destroyed...')
else:
print('No instances running')
# delete security groups
for group in conn.ex_list_security_groups():