Install and configure AWS command line interface

While deploying Access Gateway into an Amazon Web Services environment, you can use the Command Line Interface (CLI) to do numerous tasks. Command line interface commands are often easier, script-able, and often support tasks not supported in the AWS console.

During this task we will install and configure the AWS command line interface.

Before you begin

Ensure that you have:

  • An AWS account
  • Access to a supported command line environment such as Windows, Linux or Apple OSX.

Install the AWS command line interface

You can install the command line interface in a variety of environments.

The AWS CLI install process is governed by Amazon and may change. This page is meant as a guide. Consult the AWS documentation for details about the command line interface and similar topics.

  1. Navigate to the AWS CLI overview page.
  2. Scroll to the install/update section and follow the instructions for your environment.

  3. For example, for MacOS:

    Copy

    Mac OSX

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

    For example, for Windows:

    Copy

    Windows command line

    msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
  4. Follow the instructions to configure your AWS command line instance.

    For example:

    Copy
    aws configure 
    AWS Access Key ID [None]: A. . . EXAMPLE
    AWS Secret Access Key [None]: wJ. . . EXAMPLEKEY
    Default region name [None]: us-east-2
    Default output format [None]: json

    See the following two sub-sections for details of determining your AWS AccessKeyID, Secrete Access Key, and region.

To determine your Access Key ID and associated key

  1. Open the IAM console at https://console.aws.amazon.com/iam/.
  2. In the navigation pane select Users.
  3. Click the name of the user requiring CLI access.
  4. Select the Security credentials tab.
  5. Click Create access key.

    The Create access key dialog will display. Click Show to display the secret access key.

  6. Use the provided values when configuring CLI access.

See the Amazon Web Services Configuration basics page for more information.

To determine your region

  1. Open a browser to https://signin.aws.amazon.com/
  2. Sign in to the AWS Console.
  3. Examine the default region as shown to the right of account information.
    Default region

See Regions and Availability Zones in the Amazon Web Services documentation for more information on AWS regions and availability zones.