From f6f93dad71348068088c1f45ccaf77a00fa57406 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov <61747324+dibir-magomedsaygitov@users.noreply.github.com> Date: Thu, 2 Jul 2020 19:29:50 +0300 Subject: [PATCH] Update AWS CLI V1 to V2 on Ubuntu 20.04 Image (#1112) * update aws cli v1 to v2 on ubuntu20 * add os.sh * minor changes --- images/linux/scripts/installers/aws.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/images/linux/scripts/installers/aws.sh b/images/linux/scripts/installers/aws.sh index fabbfe9f4bf9..6d5b403b8168 100644 --- a/images/linux/scripts/installers/aws.sh +++ b/images/linux/scripts/installers/aws.sh @@ -6,13 +6,24 @@ # Source the helpers source $HELPER_SCRIPTS/document.sh +source $HELPER_SCRIPTS/os.sh -# Install the AWS CLI -curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" -unzip awscli-bundle.zip -./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws -rm awscli-bundle.zip -rm -rf awscli-bundle +# Install the AWS CLI v1 on Ubuntu16 and Ubuntu18, and AWS CLI v2 on Ubuntu20 +if isUbuntu20 ; then + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + ./aws/install -i /usr/local/aws-cli -b /usr/local/bin + rm awscliv2.zip + rm -rf aws +fi + +if isUbuntu16 || isUbuntu18 ; then + curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" + unzip awscli-bundle.zip + ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws + rm awscli-bundle.zip + rm -rf awscli-bundle +fi # Validate the installation echo "Validate the installation"