changed aws demo3 to be compatible with AWS Educate classroom
This commit is contained in:
parent
6e2b8dc1f0
commit
4c2993182d
@ -13,8 +13,12 @@ from libcloud.compute.types import Provider, NodeState
|
|||||||
|
|
||||||
# default region
|
# default region
|
||||||
# region_name = 'eu-central-1'
|
# region_name = 'eu-central-1'
|
||||||
region_name = 'us-east-2'
|
# region_name = 'ap-south-1'
|
||||||
#region_name = 'ap-south-1'
|
|
||||||
|
# AWS Educate only allows us-east-1 see our AWS classroom at https://www.awseducate.com
|
||||||
|
# e.g., https://www.awseducate.com/student/s/launch-classroom?classroomId=a1v3m000005mNm6AAE
|
||||||
|
|
||||||
|
region_name = 'us-east-1'
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -24,10 +28,14 @@ def main():
|
|||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
access_id = getpass.win_getpass("Enter your access_id:")
|
# see AWS Educate classroom, Account Details
|
||||||
secret_key = getpass.win_getpass("Enter your secret_key:")
|
|
||||||
# access_id = "AXY..."
|
# access_id = getpass.win_getpass("Enter your access_id:")
|
||||||
# secret_key = "j1zomy61..."
|
# secret_key = getpass.win_getpass("Enter your secret_key:")
|
||||||
|
# session_token = getpass.win_getpass("Enter your session_token:")
|
||||||
|
access_id = "ASIAU..."
|
||||||
|
secret_key = "7lafW..."
|
||||||
|
session_token = "IQoJb3JpZ...EMb//..."
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
@ -38,6 +46,7 @@ def main():
|
|||||||
provider = get_driver(Provider.EC2)
|
provider = get_driver(Provider.EC2)
|
||||||
conn = provider(access_id,
|
conn = provider(access_id,
|
||||||
secret_key,
|
secret_key,
|
||||||
|
token=session_token,
|
||||||
region=region_name)
|
region=region_name)
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
@ -63,7 +72,7 @@ def main():
|
|||||||
# if we see any demo instances still running continue to wait for them to stop
|
# if we see any demo instances still running continue to wait for them to stop
|
||||||
if instance.name in ['all-in-one', 'app-worker-1', 'app-worker-2', 'app-worker-3', 'app-controller',
|
if instance.name in ['all-in-one', 'app-worker-1', 'app-worker-2', 'app-worker-3', 'app-controller',
|
||||||
'app-services', 'app-api-1', 'app-api-2']:
|
'app-services', 'app-api-1', 'app-api-2']:
|
||||||
if instance.state.value is not 'terminated':
|
if instance.state.value != 'terminated':
|
||||||
nodes_still_running = True
|
nodes_still_running = True
|
||||||
print('There are still instances running, waiting for them to be destroyed...')
|
print('There are still instances running, waiting for them to be destroyed...')
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ from libcloud.compute.types import Provider
|
|||||||
|
|
||||||
# The image to look for and use for the started instance
|
# The image to look for and use for the started instance
|
||||||
ubuntu_image_name = 'ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200408'
|
ubuntu_image_name = 'ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200408'
|
||||||
#ubuntu_image_id = "ami-0e342d72b12109f91" # local ami id for resent ubuntu 18.04 20200408 in eu-central-1
|
# ubuntu_image_id = "ami-0e342d72b12109f91" # local ami id for resent ubuntu 18.04 20200408 in eu-central-1
|
||||||
|
|
||||||
# The public key to be used for SSH connection, please make sure, that you have the corresponding private key
|
# The public key to be used for SSH connection, please make sure, that you have the corresponding private key
|
||||||
#
|
#
|
||||||
@ -23,9 +23,13 @@ pub_key_file = '~/.ssh/id_rsa.pub'
|
|||||||
flavor_name = 't2.nano'
|
flavor_name = 't2.nano'
|
||||||
|
|
||||||
# default region
|
# default region
|
||||||
region_name = 'eu-central-1'
|
# region_name = 'eu-central-1'
|
||||||
# region_name = 'us-east-2'
|
# region_name = 'ap-south-1'
|
||||||
#region_name = 'ap-south-1'
|
|
||||||
|
# AWS Educate only allows us-east-1 see our AWS classroom at https://www.awseducate.com
|
||||||
|
# e.g., https://www.awseducate.com/student/s/launch-classroom?classroomId=a1v3m000005mNm6AAE
|
||||||
|
|
||||||
|
region_name = 'us-east-1'
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -35,10 +39,14 @@ def main():
|
|||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
access_id = getpass.win_getpass("Enter your access_id:")
|
# see AWS Educate classroom, Account Details
|
||||||
secret_key = getpass.win_getpass("Enter your secret_key:")
|
|
||||||
# access_id = "AXY..."
|
# access_id = getpass.win_getpass("Enter your access_id:")
|
||||||
# secret_key = "j1zomy61..."
|
# secret_key = getpass.win_getpass("Enter your secret_key:")
|
||||||
|
# session_token = getpass.win_getpass("Enter your session_token:")
|
||||||
|
access_id = "ASIAU..."
|
||||||
|
secret_key = "7lafW..."
|
||||||
|
session_token = "IQoJb3JpZ...EMb//..."
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
@ -49,6 +57,7 @@ def main():
|
|||||||
provider = get_driver(Provider.EC2)
|
provider = get_driver(Provider.EC2)
|
||||||
conn = provider(access_id,
|
conn = provider(access_id,
|
||||||
secret_key,
|
secret_key,
|
||||||
|
token=session_token,
|
||||||
region=region_name)
|
region=region_name)
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user