### Installers

To install the Linux (x86 & ARM) installers, and Windows MSI preview artifacts, follow the [official AWS CLI v2 installation guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

Note: The internal private release installers are nested archives. Unlike in the official installation guide, you will
need to run `unzip` twice: once on the artifact, and again on the nested archive.

The following example demonstrates installing the AWS CLI v2 from the Linux ARM64 installer (no root required):

```bash
unzip awsCliLinuxArmExe.zip
unzip awscli-exe-linux-aarch64.zip
./aws/install -i <prefix>/aws-cli -b <prefix>/bin
```

Verify the installation by running `aws --version` (or `<prefix>/bin/aws --version`) and testing out the new/updated models.

For **macOS** users, you can either use the provided docker images or install from source as instructed below.

### Source Distribution Installation Instructions

For guidance installing the AWS CLI v2 from source:

- [AWS CLI v2 source installation](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-source-install.html) - General source installation information

To build and install the AWS CLI v2 from source, follow these steps for your system:

#### For Linux and macOS:

1. Verify that you have an environment that can run [GNU Autotools](https://www.gnu.org/software/automake/faq/autotools-faq.html)
   generated files such as `configure` and `Makefile`.

If Autotools is not already installed in your environment or you need to update them, then follow the installation
instructions found in
[How do I install the Autotools (as user)?](https://www.gnu.org/software/automake/faq/autotools-faq.html#How-do-I-install-the-Autotools-_0028as-user_0029_003f)
or [Basic Installation](https://www.gnu.org/savannah-checkouts/gnu/automake/manual/automake.html#Basic-Installation)
in the _GNU documentation_.

2. Verify that a supported Python interpreter is installed. To see a list of supported Python interpreter versions, see
   the [AWS CLI v2 GitHub README](https://github.com/aws/aws-cli/tree/v2#aws-cli).

3. Unzip the source distribution artifact:

   ```bash
   unzip awsCliDist.zip
   ```

4. **(Optional)** To verify the integrity of the artifact using signature verification, follow the verification steps
   in our official
   [AWS CLI v2 source installation User Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-source-install.html).
5. Extract the nested tarball:

   ```bash
   tar -xzf awscli.tar.gz
   ```

This command will extract a directory with the name `awscli-<version>`. Take note of this directory name as it will be
used in subsequent steps.

6. Change directory to the extracted source directory in the previous step:

   ```bash
   cd awscli-2.*
   ```

7. Configure the AWS CLI v2 installation to automatically download dependencies and freeze a copy of the current
   Python interpreter:

   ```bash
   ./configure --with-download-deps --with-install-type=portable-exe
   ```

Additionally, you can specify the path to the Python interpreter you'd like to use to run the AWS CLI v2 by setting the
`PYTHON` environment variable when running the `configure` script. By default, the installer will try to
auto-select one on your machine or the active virtual environment.

Advanced configuration example:

```bash
PYTHON=<path> ./configure --with-download-deps --with-install-type=portable-exe
```

8. Build the AWS CLI v2:

   ```bash
   make
   ```

9. Install the AWS CLI v2:

   ```bash
   make install
   ```

You can specify a destination directory for the installation via the `DESTDIR` environment variable when running
`make install`. We recommend doing this during testing to avoid overwriting your primary AWS CLI v2 installation.

Example:

```bash
make DESTDIR=/tmp/testing install
```

10. Verify the AWS CLI v2 installation:

```bash
aws --version
```

If you specified a custom destination directory in the previous step, you should use it when verifying your installation
and testing your feature. For example,

```bash
/tmp/testing/usr/local/bin/aws --version
```

### Docker Installation Instructions

For Docker usage guidance:

- [AWS CLI Docker documentation](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-docker.html) - General usage information
- [Internal Docker usage documentation](https://docs.hub.amazon.dev/containers/docker/) - Information about Docker Desktop licensing and alternatives like Finch

Note: The following commands use Docker syntax. For Finch, simply replace `docker` with `finch` in all commands.

To load the Docker images, follow these steps for your system architecture:

#### For x86_64 systems:

1. Unzip the Docker image artifact:

   ```bash
   unzip awsCliX86DockerImage.zip
   ```

2. Load the Docker image:
   ```bash
   docker load -i aws-cli-docker.tar
   ```

#### For ARM64 systems:

1. Unzip the Docker image artifact:

   ```bash
   unzip awsCliArmDockerImage.zip
   ```

2. Load the Docker image:
   ```bash
   docker load -i aws-cli-docker.tar
   ```

#### For all systems:

3. Verify the image is available:

   ```bash
   docker image ls
   ```

   Note: Use the image name and tag as shown in the output of `docker image ls`. Using the Image ID that matches the timestamp when you loaded the image may be more reliable because you won't accidentally pull the public image with the latest tag.

4. Run the container:
   ```bash
   # Using Docker (with Image ID)
   docker run --rm -it <IMAGE ID> --version
   # Or using Docker (with repository name)
   docker run --rm -it <image-name>:<tag> --version
   ```

## Support

If you encounter problems or wish to provide feedback, notify the point of contact in the emailed instructions for this private release.
