AWS cli setup windows 10 2021
Enjoying this content? Subscribe to the Channel!
Mastering the Command Line: How to Set Up AWS CLI on Windows 10 (A Step-by-Step Guide)
Hello, Fellow Tech Enthusiasts!
Welcome back to Darren’s Tech Tutorials! If you’re serious about managing your cloud resources efficiently, ditching the web console for everyday tasks is a game-changer. That’s where the Amazon Web Services Command Line Interface (AWS CLI) comes in.
The AWS CLI is a powerful unified tool that allows you to manage your AWS services directly from your terminal or command prompt. Whether you need to quickly check S3 bucket contents, spin up an EC2 instance, or automate routine tasks, the CLI is your essential tool.
In this comprehensive guide, we’re walking through the entire process on Windows 10: from installation to securing your configuration. Let’s dive in and get you running commands like a pro!
Step 1: Installing the AWS CLI on Windows 10
The installation process for the AWS CLI Version 2 (V2) on Windows is straightforward thanks to the dedicated MSI installer.
Action Plan:
- Download the Installer: Navigate to the official AWS documentation page for the AWS CLI V2 installation on Windows. Look for the “Download the latest MSI installer” link.
- Run the Installer: Once the file is downloaded, double-click the
.msifile to start the installation wizard. - Follow the Prompts: The installation is standard. Accept the license agreement, choose the installation destination (the default is usually fine), and click ‘Install.’
- Finish: Click ‘Finish’ to complete the setup.
Verification Check
To ensure the installation was successful and Windows can find the aws command, open your Command Prompt or PowerShell and run the following command:
aws --version
You should see output similar to this (version numbers may vary):
aws-cli/2.15.10 Python/3.11.6 Windows/10 exe/AMD64 prompt/off
If you see the version details, congratulations! The installation is complete.
Step 2: Setting Up Your Secure IAM User
You should never use your root AWS account access keys for programmatic access. Security best practice dictates creating a dedicated Identity and Access Management (IAM) user. This user will provide the access keys needed for the CLI configuration.
Action Plan:
- Log into the AWS Console: Navigate to the AWS Management Console and log in.
- Access IAM: Search for “IAM” in the service search bar and click on the IAM dashboard.
- Create a New User: In the navigation pane, click Users, and then click Add users.
- Set User Details:
- Choose a descriptive name (e.g.,
cli-user-windows). - Under ‘Select AWS access type,’ check the box for Access key - Programmatic access. This is vital! Do not select Console password unless you also want web console access.
- Choose a descriptive name (e.g.,
- Set Permissions:
- For testing purposes, you might select Attach existing policies directly and choose
AdministratorAccess. - Pro Tip: For production environments, always adhere to the principle of least privilege. Only grant the specific permissions this user needs.
- For testing purposes, you might select Attach existing policies directly and choose
- Review and Create: Review your settings and click Create user.
Save Your Keys Securely
The next screen is the most important part of this entire step! AWS will display the Access key ID and the Secret access key.
⚠️ Warning: You will not be able to retrieve the Secret Access Key again after this screen!
- Click Download .csv to save the credentials file immediately.
- Copy and paste both the Access Key ID and Secret Access Key into a secure location. You will need them in the next step.
Step 3: Configuring the AWS CLI
With your AWS CLI installed and your IAM access keys ready, it’s time to link the two using the aws configure command.
Action Plan:
-
Open Command Prompt/PowerShell: Ensure you are in a new terminal window.
-
Run the configuration command:
aws configure -
Enter the required details when prompted:
Prompt Your Input Notes AWS Access Key ID [None]:Paste your new IAM User Access Key ID here. Starts with AKIA...AWS Secret Access Key [None]:Paste the Secret Access Key here. This is long and complex. Default region name [None]:Enter your preferred region (e.g., us-east-1oreu-central-1).This is the region AWS will default to if not specified in the command. Default output format [None]:We recommend typing json.This formats the output cleanly for machine reading. Other options are textortable.
Once you’ve answered the four prompts, the configuration is complete! The AWS CLI stores these credentials locally in the .aws directory within your user profile.
Step 4: Verifying Your New Configuration
Now for the ultimate test! Let’s run a simple command to ensure the AWS CLI is connecting successfully to your AWS account.
A great test command is listing your S3 buckets, as it requires authentication and interaction with an AWS service.
Run this command in your terminal:
aws s3 ls
Expected Results:
- Success: If the command executes successfully, it will either return a list of your existing S3 buckets or simply return an empty line if you have none. This confirms the CLI is configured correctly!
- Failure: If you receive an error like
An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied, double-check the permissions you assigned to the IAM user in Step 2. - Authentication Failure: If you get an error referencing “InvalidAccessKeyId” or “SignatureDoesNotMatch,” immediately re-run
aws configureand ensure you are copying and pasting the Access Key ID and Secret Access Key precisely.
You’re Ready to Command the Cloud!
That’s all there is to it! You have successfully installed, secured, and configured the AWS CLI on your Windows machine. You now hold the power to interact with hundreds of AWS services directly from your command line, opening up huge opportunities for automation and efficiency.
Ready to take the next step? Now that your CLI is set up, you can start running powerful scripts and managing your cloud infrastructure faster than ever before.
If this tutorial helped you get up and running, please give the video a like and subscribe to Darren’s Tech Tutorials for more clear, accessible technology guides. Let me know in the comments what AWS service you plan to manage first with your new CLI setup! Happy commanding!