Wondering how to manually install the AWS CLI on EC2 Windows? We can help you.
With AWS CLI, we can manage multiple AWS services and automate common service and resource actions through scripts.
Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.
Today, let us see how to manually install AWS CLI.
Manually install the AWS CLI on EC2 Windows
First and foremost, ensure the instance has internet access using a network address translation (NAT) instance or an internet gateway.
In order to begin, our Support Techs suggest we have the following:
- A 64-bit version of Windows XP or later.
- Admin rights to install software
Install or update the AWS CLI version 2 on Windows using the MSI installer
To do so, each time we update to overwrite previous versions we download a new installer.
We can find the latest version of AWS CLI, we go to the AWS CLI version 2 changelog on GitHub.
1. Initially, we download and run the AWS CLI MSI installer for Windows (64-bit):
- The latest version of the AWS CLI: https://awscli.amazonaws.com/AWSCLIV2.msi
- A specific version of the AWS CLI: Append a hyphen and the version number to the filename.
Here, the filename for version 2.0.30 will be AWSCLIV2-2.0.30.msi
Alternatively, to run the MSI installer we run:
C:\> msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
We can use various parameters with msiexec. To see them, we check on the Microsoft Docs website.
2. To confirm the installation, we go to the Start menu > search for cmd > use the aws –version command.
Since in this case, the command is Windows-specific we include the prompt symbol (C:\>). Otherwise, we use the generic prompt symbol ($).
C:\> aws --version aws-cli/2.1.29 Python/3.7.4 Windows/10 botocore/2.0.0
Suppose Windows fails to find the program. Then we need to close and reopen the command prompt window or add the installation directory to the PATH environment variable manually.
Uninstall the AWS CLI version 2 from Windows
1. To do so, we open Programs and Features using either of these options:
- Open the Control Panel > Programs and Features.
- Open a command prompt, run:
2. Then we select the entry, AWS Command Line Interface, and then choose Uninstall to launch the uninstaller.
3. We need to confirm to uninstall the AWS CLI.
Suppose we have AWS CLI version 1, it’s a best practice to uninstall it and use only AWS CLI version 2.
To get help with any command when using the AWS CLI, simply type help at the end of a command name.
For example, the following command displays help for the general AWS CLI options:
$ aws help
The following command displays the available Amazon EC2 specific commands:
$ aws ec2 help
The AWS CLI uses a multipart structure on the command line. It must specify in the order below:
- The base call to the AWS program.
- Then the top-level command, which typically corresponds to an AWS service supported by the AWS CLI.
- Finally, the subcommand specifies which operation to perform.
$ aws <command> <subcommand> [options and parameters]
Parameters can be numbers, strings, lists, maps, and JSON structures. It is dependent upon the command and subcommand we specify.
[Need help with the installation? We’d be happy to assist]
In short, we saw how our Support Techs manually install AWS CLI for our customers.