Amazon CLI version 2 migration instructions - Amazon Command Line Interface
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).

Amazon CLI version 2 migration instructions

This topic provides instructions for migrating from Amazon CLI version 1 to Amazon CLI version 2.

Amazon CLI versions 1 and 2 use the same aws command name. If you have both versions installed, your computer uses the first one found in your search path. If you previously installed Amazon CLI version 1, we recommend that you do one of the following to use Amazon CLI version 2:

For information on breaking changes between version 1 and version 2, see New features and changes in Amazon CLI version 2.

Replacing version 1 with version 2

Perform the following steps to replace Amazon CLI version 1 with Amazon CLI version 2.

To replace Amazon CLI version 1 with Amazon CLI version 2
  1. Prepare any existing scripts you have for the migration by confirming any breaking changes between version 1 and version 2 in New features and changes in Amazon CLI version 2.

  2. Uninstall the Amazon CLI version 1 by following the uninstall instructions for your operating system in Installing, updating, and uninstalling the Amazon CLI version 1.

  3. Confirm that the Amazon CLI is completely uninstalled by using the following command.

    $ aws --version

    Complete one of the following based on the output:

  4. Install the Amazon CLI version 2 by following the appropriate install instructions for your operating system in Install or update to the latest version of the Amazon CLI.

Side-by-side install

To have both versions installed, use your operating system's ability to create a symbolic link (symlink) or alias with a different name for one of the two aws commands.

  1. Install the Amazon CLI version 2 by following the appropriate install instructions for your operating system in Install or update to the latest version of the Amazon CLI.

  2. Use your operating system's ability to create a symlink or alias with a different name for one of the two aws commands, such as using aws2 for Amazon CLI version 2. The following are symlink examples for Amazon CLI version 2. Replace the PATH with your install location.

    Linux and macOS

    You can use a symbolic link or alias on Linux and macOS.

    $ alias aws2='PATH'
    Windows command prompt

    DOSKEY on Windows.

    C:\> doskey aws2=PATH