From d88c0c7bdd66285eaf916128311edb6fbd87afec Mon Sep 17 00:00:00 2001 From: Franco Rezabek <43790446+rezabekf@users.noreply.github.com> Date: Fri, 12 May 2023 12:28:52 +0100 Subject: [PATCH 1/5] Update aws cli to v2 --- code/solutions/cloud9/awscliv2.sh | 34 +++++++++++++++++++++++++++ content/prerequisites/cloud9/index.md | 28 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100755 code/solutions/cloud9/awscliv2.sh diff --git a/code/solutions/cloud9/awscliv2.sh b/code/solutions/cloud9/awscliv2.sh new file mode 100755 index 000000000..3684b01cc --- /dev/null +++ b/code/solutions/cloud9/awscliv2.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Check system architecture +ARCH=$(uname -m) +if [ "$ARCH" == "x86_64" ] +then + AWSCLI_PKG="awscli-exe-linux-x86_64.zip" +elif [ "$ARCH" == "aarch64" ] +then + AWSCLI_PKG="awscli-exe-linux-aarch64.zip" +else + echo "Unsupported architecture: $ARCH" + exit 1 +fi + +# Check if awscli version 1 is installed +if yum list installed | grep awscli &> /dev/null +then + echo "awscli version 1 is installed, removing..." + # Uninstall awscli version 1 + sudo yum remove -y awscli +fi + +# Install awscli version 2 +curl "https://awscli.amazonaws.com/$AWSCLI_PKG" -o "awscliv2.zip" +unzip -q awscliv2.zip +sudo ./aws/install + +# Print awscli version +aws --version + +# Clean up +rm -f awscliv2.zip +rm -rf aws/ diff --git a/content/prerequisites/cloud9/index.md b/content/prerequisites/cloud9/index.md index ef3ad8e01..122f03ed9 100644 --- a/content/prerequisites/cloud9/index.md +++ b/content/prerequisites/cloud9/index.md @@ -29,6 +29,34 @@ We recommend using **us-east-1 (N. Virginia)** as the _AWS Region_ for the works If you have issues using the Cloud9 environment, please see the [Troubleshooting AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/troubleshooting.html) page in the user guide. ::: +### Install the latest version of AWS CLI + +Cloud9 Instance comes pre-installed with AWS CLI version one. For the workshop we require to use AWS CLI version 2. +To make the migration from version 1 to version 2 easier you can use the script provided. + +The script will: +* Check for system architecture to download correct bundle. +* Check if the AWS CLI version 1 is installed, and if yes removes it. +* Installs AWS CLI version 2. +* Cleans up installation files. + +1. In the **Cloud9 terminal** navigate to `cfn101-workshop/code/solutions/cloud9`: +:::code{language=shell showLineNumbers=false showCopyAction=true} +cd cfn101-workshop/code/solutions/cloud9 +::: +1. Make the script executable: +:::code{language=shell showLineNumbers=false showCopyAction=true} +chmod +x awscliv2.sh +::: +1. Run the script: +:::code{language=shell showLineNumbers=false showCopyAction=true} +source awscliv2.sh +::: +1. Check that the installation was successful, and you have the latest version of AWS CLI: +:::code{language=shell showLineNumbers=false showCopyAction=true} +aws --version +::: + ### Clone lab resources using `git` Clone the repository to your working directory. In the Cloud9 terminal run: From ad74c0834b14a6767eeff4c513abdc3ced4f5aab Mon Sep 17 00:00:00 2001 From: Franco Rezabek <43790446+rezabekf@users.noreply.github.com> Date: Fri, 12 May 2023 12:36:28 +0100 Subject: [PATCH 2/5] Update content/prerequisites/cloud9/index.md --- content/prerequisites/cloud9/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/prerequisites/cloud9/index.md b/content/prerequisites/cloud9/index.md index 122f03ed9..96786466d 100644 --- a/content/prerequisites/cloud9/index.md +++ b/content/prerequisites/cloud9/index.md @@ -31,7 +31,7 @@ If you have issues using the Cloud9 environment, please see the [Troubleshooting ### Install the latest version of AWS CLI -Cloud9 Instance comes pre-installed with AWS CLI version one. For the workshop we require to use AWS CLI version 2. +Cloud9 Instance comes pre-installed with AWS CLI version 1. For the workshop we require to use AWS CLI version 2. To make the migration from version 1 to version 2 easier you can use the script provided. The script will: From 941669baec9b34bf0706b1bef07a8bb27e8a8cc0 Mon Sep 17 00:00:00 2001 From: Franco Rezabek <43790446+rezabekf@users.noreply.github.com> Date: Fri, 12 May 2023 12:46:41 +0100 Subject: [PATCH 3/5] Add links to the official docs --- content/prerequisites/cloud9/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/prerequisites/cloud9/index.md b/content/prerequisites/cloud9/index.md index 96786466d..192eb4254 100644 --- a/content/prerequisites/cloud9/index.md +++ b/content/prerequisites/cloud9/index.md @@ -31,8 +31,8 @@ If you have issues using the Cloud9 environment, please see the [Troubleshooting ### Install the latest version of AWS CLI -Cloud9 Instance comes pre-installed with AWS CLI version 1. For the workshop we require to use AWS CLI version 2. -To make the migration from version 1 to version 2 easier you can use the script provided. +Cloud9 Instance comes pre-installed with [AWS CLI version 1](https://docs.aws.amazon.com/cli/v1/userguide/install-linux-al2017.html). For the workshop we require to use [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). +To make the [migration](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-instructions.html) from version 1 to version 2 easier you can use the script provided. The script will: * Check for system architecture to download correct bundle. From 8c6549c77c8094357e095e0f7c94c51577c5c8de Mon Sep 17 00:00:00 2001 From: Franco Rezabek <43790446+rezabekf@users.noreply.github.com> Date: Fri, 12 May 2023 12:48:18 +0100 Subject: [PATCH 4/5] Update content/prerequisites/cloud9/index.md --- content/prerequisites/cloud9/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/prerequisites/cloud9/index.md b/content/prerequisites/cloud9/index.md index 192eb4254..25a853cf1 100644 --- a/content/prerequisites/cloud9/index.md +++ b/content/prerequisites/cloud9/index.md @@ -32,7 +32,7 @@ If you have issues using the Cloud9 environment, please see the [Troubleshooting ### Install the latest version of AWS CLI Cloud9 Instance comes pre-installed with [AWS CLI version 1](https://docs.aws.amazon.com/cli/v1/userguide/install-linux-al2017.html). For the workshop we require to use [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). -To make the [migration](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-instructions.html) from version 1 to version 2 easier you can use the script provided. +To make the [migration](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-instructions.html) from version 1 to version 2 easier, you can use the script provided. The script will: * Check for system architecture to download correct bundle. From 06a32211753fcefda3a3629b708be0431e623827 Mon Sep 17 00:00:00 2001 From: Franco Rezabek <43790446+rezabekf@users.noreply.github.com> Date: Mon, 15 May 2023 12:09:52 +0100 Subject: [PATCH 5/5] Update order --- content/prerequisites/cloud9/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/prerequisites/cloud9/index.md b/content/prerequisites/cloud9/index.md index 192eb4254..1b3516928 100644 --- a/content/prerequisites/cloud9/index.md +++ b/content/prerequisites/cloud9/index.md @@ -29,6 +29,13 @@ We recommend using **us-east-1 (N. Virginia)** as the _AWS Region_ for the works If you have issues using the Cloud9 environment, please see the [Troubleshooting AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/troubleshooting.html) page in the user guide. ::: +### Clone lab resources using `git` +Clone the repository to your working directory. In the Cloud9 terminal run: + +:::code{language=shell showLineNumbers=false showCopyAction=true} +git clone https://github.com/aws-samples/cfn101-workshop +::: + ### Install the latest version of AWS CLI Cloud9 Instance comes pre-installed with [AWS CLI version 1](https://docs.aws.amazon.com/cli/v1/userguide/install-linux-al2017.html). For the workshop we require to use [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). @@ -57,13 +64,6 @@ source awscliv2.sh aws --version ::: -### Clone lab resources using `git` -Clone the repository to your working directory. In the Cloud9 terminal run: - -:::code{language=shell showLineNumbers=false showCopyAction=true} -git clone https://github.com/aws-samples/cfn101-workshop -::: - ### Open workshop files The templates and code you will work on is located in the **code** folder. Expand the tree on the left to open the **code** folder: