Skip to content

Instantly share code, notes, and snippets.

@TeemuKoivisto
Last active September 7, 2023 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TeemuKoivisto/a99d51a2e4d86ebefad353ab2d4273ae to your computer and use it in GitHub Desktop.
Save TeemuKoivisto/a99d51a2e4d86ebefad353ab2d4273ae to your computer and use it in GitHub Desktop.
Installs AWS CLI v2 with Bash for Linux x86 / ARM
#!/usr/bin/env bash
# or for alpine #!/bin/sh
########################################################
# Installs AWS CLI v2 https://docs.aws.amazon.com/cli/ #
########################################################
# Needs curl or wget and unzip installed
# If you are using Alpine, you should use apk directly (because reasons https://github.com/aws/aws-cli/issues/4971)
# apk add aws-cli=2.13.5-r0
if [ "$(command -v curl)" ]; then
curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "/tmp/awscliv2.zip" && \
unzip "/tmp/awscliv2.zip" -d /tmp && \
/tmp/aws/install
else
wget -O "/tmp/awscliv2.zip" "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" && \
unzip "/tmp/awscliv2.zip" -d /tmp && \
/tmp/aws/install
fi
aws --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment