Install the Amazon CLI - Amazon EMR
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Install the Amazon CLI

You can install the latest version of the Amazon CLI for macOS, Linux, or Windows.

Important

To set up Amazon EMR on EKS, you must have the latest version of Amazon CLI installed.

To install or update the Amazon CLI for macOS

  1. If you currently have the Amazon CLI installed, determine which version that you have installed.

    aws --version
  2. If you have an earlier version of Amazon CLI, then use the following command to install the latest Amazon CLI version 2. For other installation options, or to upgrade your currently installed version 2, see Upgrading the Amazon CLI version 2 on macOS.

    curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" sudo installer -pkg AWSCLIV2.pkg -target /

    If you're unable to use the Amazon CLI version 2, then ensure that you have the latest version of the Amazon CLI version 1 installed using the following command.

    pip3 install awscli --upgrade --user

To install or update the Amazon CLI for Linux

  1. If you currently have the Amazon CLI installed, determine which version that you have installed.

    aws --version
  2. If you have an earlier version of Amazon CLI, then use the following command to install the latest Amazon CLI version 2. For other installation options, or to upgrade your currently installed version 2, see Upgrading the Amazon CLI version 2 on Linux.

    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install

    If you're unable to use the Amazon CLI version 2, then ensure that you have the latest version of the Amazon CLI version 1 installed using the following command.

    pip3 install --upgrade --user awscli

To install or update the Amazon CLI for Windows

  1. If you currently have the Amazon CLI installed, determine which version that you have installed.

    aws --version
  2. If you have an earlier version of Amazon CLI, then use the following command to install the latest Amazon CLI version 2. For other installation options, or to upgrade your currently installed version 2, see Upgrading the Amazon CLI version 2 on Windows.

    1. Download the Amazon CLI MSI installer for Windows (64-bit) at https://awscli.amazonaws.com/AWSCLIV2.msi

    2. Run the downloaded MSI installer and follow the onscreen instructions. By default, the Amazon CLI installs to C:\Program Files\Amazon\AWSCLIV2.

    If you're unable to use the Amazon CLI version 2, then ensure that you have the latest version of the Amazon CLI version 1 installed using the following command.

    pip3 install --user --upgrade awscli

Configure your Amazon CLI credentials

Both eksctl and the Amazon CLI require that you have Amazon credentials configured in your environment. The aws configure command is the fastest way to set up your Amazon CLI installation for general use.

$ aws configure Amazon Access Key ID [None]: <AKIAIOSFODNN7EXAMPLE> Amazon Secret Access Key [None]: <wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY> Default region name [None]: <region-code> Default output format [None]: <json>

When you type this command, the Amazon CLI prompts you for four pieces of information: Access key, secret access key, Amazon Region, and output format. This information is stored in a profile (a collection of settings) named default. This profile is used when you run commands unless you specify another one. For more information, see Configuring the Amazon CLI in the Amazon Command Line Interface User Guide.