|
|
@ -30,8 +30,15 @@ ubuntu_image_name = 'ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-2021 |
|
|
|
# id_rsa.pub should look like this (standard sshd pubkey format): |
|
|
|
# ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAw+J...F3w2mleybgT1w== user@HOSTNAME |
|
|
|
|
|
|
|
keypair_name = 'srieger-pub' |
|
|
|
pub_key_file = home + '/.ssh/id_rsa.pub' |
|
|
|
# use existing vockey in AWS Lab env from vocareum, enables login directly |
|
|
|
# from the lab's terminal: |
|
|
|
# |
|
|
|
# ssh -i ~/.ssh/labuser.pem ubuntu@<public-ip> |
|
|
|
# |
|
|
|
keypair_name = "vockey" |
|
|
|
|
|
|
|
# keypair_name = 'srieger-pub' |
|
|
|
# pub_key_file = home + '/.ssh/id_rsa.pub' |
|
|
|
|
|
|
|
# flavor_name = 't2.nano' |
|
|
|
flavor_name = 't2.micro' |
|
|
@ -297,8 +304,9 @@ def main(): |
|
|
|
ex_keyname=keypair_name, |
|
|
|
ex_userdata=userdata_service, |
|
|
|
ex_security_groups=["services"]) |
|
|
|
instance_services = conn.wait_until_running(nodes=[instance_services], timeout=120, ssh_interface='public_ips') |
|
|
|
instance_services = conn.wait_until_running(nodes=[instance_services], timeout=timeout, ssh_interface='public_ips') |
|
|
|
services_ip = instance_services[0][0].private_ips[0] |
|
|
|
print(instance_services) |
|
|
|
|
|
|
|
########################################################################### |
|
|
|
# |
|
|
@ -330,10 +338,10 @@ def main(): |
|
|
|
ex_userdata=userdata_api, |
|
|
|
ex_security_groups=["api"]) |
|
|
|
|
|
|
|
instance_api_1 = conn.wait_until_running(nodes=[instance_api_1], timeout=120, ssh_interface='public_ips') |
|
|
|
instance_api_1 = conn.wait_until_running(nodes=[instance_api_1], timeout=timeout, ssh_interface='public_ips') |
|
|
|
api_1_ip = instance_api_1[0][0].private_ips[0] |
|
|
|
print("app-api-1 public ip: " + instance_api_1[0][1][0]) |
|
|
|
instance_api_2 = conn.wait_until_running(nodes=[instance_api_2], timeout=120, ssh_interface='public_ips') |
|
|
|
instance_api_2 = conn.wait_until_running(nodes=[instance_api_2], timeout=timeout, ssh_interface='public_ips') |
|
|
|
# currently only api_1_ip is used |
|
|
|
api_2_ip = instance_api_2[0][0].private_ips[0] |
|
|
|
print("app-api-2 public ip: " + instance_api_2[0][1][0]) |
|
|
|