Download the AWS CLI version 2
These are steps to download the AWS CLI version 2.
You can install the AWS CLI version 2 by using one of the following methods.
- Install AWS CLI version 2 , and then apply the EC2 CLI update for the ODB network
- Build and install the AWS CLI version 2 from the source.
- Use Docker Image to install the AWS CLI version 2.
Note
These following methods have 2-step processes:
These following methods have 2-step processes:
- Installing the AWS CLI version 2 with the ODB network access.
- Adding an additional access to EC2 to
create-route
API for the-odb-network-arn
parameter.
Method 1:
- Follow the steps to install AWS CLI version 2, and apply the EC2 CLI update for the ODB network.
- To learn how to install the
Linux x86
orLinux ARM
installers, andWindows MSI
preview artifacts, see Installing or updating to the latest version of the AWS CLI. - Verify the installation by running
aws --version
command, and testing the new or updated installation. - If your operating system is Linux, use the following script to configure environment variable for the AWS CLI. For more information, see Configure the AWS CLI.
$ export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE $ export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY $ export AWS_DEFAULT_REGION=us-east-1 $ export AWS_CLI_FILE_ENCODING=UTF-8
- If your operating system is Windows, use the following script to configure environment variable for the AWS CLI.
$ set AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE $ set AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY $ set AWS_DEFAULT_REGION=us-east-1 $ set AWS_CLI_FILE_ENCODING=UTF-8
- Use the following command to download the
ec2-service-2.json
file.$ aws s3 cp s3://odb-preview-builds/odb-preview-sdks/12-17-2024/odb-cli-v2/ec2-service-2.json ~/Downloads/
- After the AWS CLI installation and downloading the
ec2-service-2.json
file, apply the EC2 CLI update by running the following command using theec2-service-2.json
that is provided.$ aws configure add-model --service-model file://<path-to-ec2-service-json>/ec2-service-2.json --service-name ec2
- To learn how to install the
- Verify your ODB access with AWS CLI.
- Use the following command to verify your access to the
--odb-network-arn
parameter for the EC2 CLI.$ aws ec2 create-route help
- Check to see
[--odb-network-arn <value>]
within the help description for thecreate-route
API.create-route [--destination-prefix-list-id <value>] [--vpc-endpoint-id <value>] [--transit-gateway-id <value>] [--local-gateway-id <value>] [--carrier-gateway-id <value>] [--core-network-arn <value>] [--odb-network-arn <value>]
- Use the following command to verify your access to the
Method 2:
- Follow the steps to build and install the AWS CLI version 2 from the source.
Note
This method includes EC2 CLI update for the ODB network, and ODB service CLI.
- Use the following command to list all of the available SDK options.
$ aws s3 ls --recursive s3://odb-preview-builds/odb-preview-sdks/12-17-2024/
- Download the AWS CLI version 2 source distribution artifact that is compatible with your operation system. The file is
awsCliDist.zip.
$ aws s3 cp s3://odb-preview-builds/odb-preview-sdks/12-17-2024/odb-cli-v2/awsCliDist.zip /Downloads/
For more information, see Building and installing the AWS CLI from source.
Method 3:
- Follow the steps to use Docker Image to install AWS CLI version 2.
- Use the following command to download Docker image artifact from S3.
$ aws s3 cp s3://odb-preview-builds/odb-preview-sdks/12-17-2024/odb-cli-v2/awsCliX86DockerImage.zip ~/Downloads/
- Use the following command to unzip the Docker image artifact.
$ unzip awsCliX86DockerImage.zip
- Use the following command to load the image.
$ docker load -i aws-cli-docker.tar
- To verify if the image is available, run the following command.
$ docker image ls
- Apply the EC2 CLI update by running the following command using the
ec2-service-2.json
provided.$ aws configure add-model --service-model file://<path-to-ec2-service-json>/ec2-service-2.json --service-name ec2
For more information, see ECR Public repository for the AWS CLI v2 .