|
@ -10,8 +10,8 @@ from botocore.exceptions import ClientError |
|
|
# |
|
|
# |
|
|
################################################################################################ |
|
|
################################################################################################ |
|
|
|
|
|
|
|
|
print("!!!!!!!! You cannot use Auto Scaling Group in AWS Educate Account !!!!!!!!") |
|
|
|
|
|
exit(-1) |
|
|
|
|
|
|
|
|
# print("!!!!!!!! You cannot use Auto Scaling Group in AWS Educate Account !!!!!!!!") |
|
|
|
|
|
# exit(-1) |
|
|
|
|
|
|
|
|
# place your credentials in ~/.aws/credentials, as mentioned in AWS Educate Classroom, |
|
|
# place your credentials in ~/.aws/credentials, as mentioned in AWS Educate Classroom, |
|
|
# Account Details, AWC CLI -> Show (Copy and paste the following into ~/.aws/credentials) |
|
|
# Account Details, AWC CLI -> Show (Copy and paste the following into ~/.aws/credentials) |
|
@ -26,15 +26,20 @@ availabilityZone3 = 'us-east-1c' |
|
|
|
|
|
|
|
|
# AMI ID of Amazon Linux 2 image 64-bit x86 in us-east-1 (can be retrieved, e.g., at |
|
|
# AMI ID of Amazon Linux 2 image 64-bit x86 in us-east-1 (can be retrieved, e.g., at |
|
|
# https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:) |
|
|
# https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:) |
|
|
|
|
|
# TODO update to recent version of Amazon Linux 2 AMI? |
|
|
imageId = 'ami-0d5eff06f840b45e9' |
|
|
imageId = 'ami-0d5eff06f840b45e9' |
|
|
# for eu-central-1, AMI ID of Amazon Linux 2 would be: |
|
|
# for eu-central-1, AMI ID of Amazon Linux 2 would be: |
|
|
# imageId = 'ami-0cc293023f983ed53' |
|
|
# imageId = 'ami-0cc293023f983ed53' |
|
|
|
|
|
|
|
|
# potentially change instanceType to t2.micro for "free tier" if using a regular account |
|
|
# potentially change instanceType to t2.micro for "free tier" if using a regular account |
|
|
# for production, t3.nano seams better |
|
|
# for production, t3.nano seams better |
|
|
instanceType = 't2.nano' |
|
|
|
|
|
|
|
|
# as of SoSe 2022 t2.nano seams to be a bit too low on memory, mariadb first start can fail |
|
|
|
|
|
# due to innodb cache out of memory, therefore t2.micro or swap in t2.nano currently recommended |
|
|
|
|
|
# instanceType = 't2.nano' |
|
|
|
|
|
instanceType = 't2.micro' |
|
|
|
|
|
|
|
|
keyName = 'srieger-pub' |
|
|
|
|
|
|
|
|
# keyName = 'srieger-pub' |
|
|
|
|
|
keyName = 'vockey' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################################ |
|
|
################################################################################################ |
|
@ -270,6 +275,7 @@ print("------------------------------------") |
|
|
|
|
|
|
|
|
response = asClient.create_launch_configuration( |
|
|
response = asClient.create_launch_configuration( |
|
|
#IamInstanceProfile='my-iam-role', |
|
|
#IamInstanceProfile='my-iam-role', |
|
|
|
|
|
IamInstanceProfile='EMR_AutoScaling_DefaultRole ', |
|
|
ImageId=imageId, |
|
|
ImageId=imageId, |
|
|
InstanceType=instanceType, |
|
|
InstanceType=instanceType, |
|
|
LaunchConfigurationName='tug-of-war-asg-launchconfig', |
|
|
LaunchConfigurationName='tug-of-war-asg-launchconfig', |
|
|