From 781cfc8fa4bf85811219bb5159a01de51f246bc4 Mon Sep 17 00:00:00 2001 From: Sebastian Rieger Date: Tue, 25 May 2021 23:40:15 +0200 Subject: [PATCH] adapted AWS CloudFormation Example for AWS Educate Classroom --- .../cloudcomp-counter-demo-with-vpc.json | 2 +- .../aws-cloudformation/cloudcomp-counter-demo.json | 2 +- .../{ => old-example-without-vpc}/start.py | 10 +++++++++- .../counter-demo/aws-cloudformation/start-with-vpc.py | 8 +++++++- .../counter-demo/aws-cloudformation/status.py | 3 ++- .../counter-demo/aws-cloudformation/stop.py | 3 ++- 6 files changed, 22 insertions(+), 6 deletions(-) rename example-projects/counter-demo/aws-cloudformation/{ => old-example-without-vpc}/start.py (77%) diff --git a/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo-with-vpc.json b/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo-with-vpc.json index 7dc37b8..0e3d8ac 100644 --- a/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo-with-vpc.json +++ b/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo-with-vpc.json @@ -3,7 +3,7 @@ "Parameters": { "paramImageID": { "Type": "AWS::EC2::Image::Id", - "Default": "ami-f573e19a", + "Default": "ami-4dd18837", "Description": "Amazon Image ID (Amazon Linux), Frankfurt ami-f573e19a, N. Virginia ami-4dd18837" }, "paramInstanceType": { diff --git a/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo.json b/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo.json index 4c6023c..0bd683a 100644 --- a/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo.json +++ b/example-projects/counter-demo/aws-cloudformation/cloudcomp-counter-demo.json @@ -3,7 +3,7 @@ "Parameters": { "paramImageID": { "Type": "AWS::EC2::Image::Id", - "Default": "ami-f573e19a", + "Default": "ami-4dd18837", "Description": "Amazon Image ID (Amazon Linux), Frankfurt ami-f573e19a, N. Virginia ami-4dd18837" }, "paramInstanceType": { diff --git a/example-projects/counter-demo/aws-cloudformation/start.py b/example-projects/counter-demo/aws-cloudformation/old-example-without-vpc/start.py similarity index 77% rename from example-projects/counter-demo/aws-cloudformation/start.py rename to example-projects/counter-demo/aws-cloudformation/old-example-without-vpc/start.py index 1739f82..cd34d0a 100644 --- a/example-projects/counter-demo/aws-cloudformation/start.py +++ b/example-projects/counter-demo/aws-cloudformation/old-example-without-vpc/start.py @@ -8,10 +8,18 @@ import boto3 ################################################################################################ -region = 'eu-central-1' +# region = 'eu-central-1' +region = 'us-east-1' stackName = 'cloudcomp-counter-demo-stack' keyName = 'srieger-pub' +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !!! +# !!! You must change vpc, subnet and availability zone below to match your zone, or use the +# !!! start-with-vpc.py example, that creates and looks up all depedencies / necessary +# !!! resources. +# !!! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ################################################################################################ # diff --git a/example-projects/counter-demo/aws-cloudformation/start-with-vpc.py b/example-projects/counter-demo/aws-cloudformation/start-with-vpc.py index b5f0ed8..388c424 100644 --- a/example-projects/counter-demo/aws-cloudformation/start-with-vpc.py +++ b/example-projects/counter-demo/aws-cloudformation/start-with-vpc.py @@ -7,8 +7,14 @@ import boto3 # ################################################################################################ +# 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) -region = 'eu-central-1' +# !!! you also need to specify an IAM role for this example to able to access S3 !!! + + +# region = 'eu-central-1' +region = 'us-east-1' stackName = 'cloudcomp-counter-demo-stack' keyName = 'srieger-pub' diff --git a/example-projects/counter-demo/aws-cloudformation/status.py b/example-projects/counter-demo/aws-cloudformation/status.py index 923e19f..e08cba9 100644 --- a/example-projects/counter-demo/aws-cloudformation/status.py +++ b/example-projects/counter-demo/aws-cloudformation/status.py @@ -10,7 +10,8 @@ import boto3 ################################################################################################ -region = 'eu-central-1' +# region = 'eu-central-1' +region = 'us-east-1' stackName = 'cloudcomp-counter-demo-stack' diff --git a/example-projects/counter-demo/aws-cloudformation/stop.py b/example-projects/counter-demo/aws-cloudformation/stop.py index 7968a92..9436f03 100644 --- a/example-projects/counter-demo/aws-cloudformation/stop.py +++ b/example-projects/counter-demo/aws-cloudformation/stop.py @@ -8,7 +8,8 @@ import boto3 ################################################################################################ -region = 'eu-central-1' +# region = 'eu-central-1' +region = 'us-east-1' stackName = 'cloudcomp-counter-demo-stack'