Table of Contents
hide
1. Prerequisites:
- Have an AWS account.
- Have permissions to create IAM (Identity and Access Management) users.
- Python (AWS CLI v1 requires Python 2.6.5 or later. AWS CLI v2 is standalone and doesn’t rely on Python).
2. Installation:
AWS CLI v1:
- Windows:
- Download the MSI installer from AWS CLI’s official page.
- Run the downloaded MSI installer.
- macOS:
curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-macos.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Linux
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
3. Configuration:
- Set up IAM User:
- Log in to the AWS Management Console.
- Navigate to IAM.
- Create a new user with programmatic access.
- Attach necessary permissions (either directly or via groups).
- Note down the
Access Key ID
andSecret Access Key
generated.
- Configure AWS CLI:
aws configure
- You’ll be prompted to enter the following:
AWS Access Key ID
: Enter the access key from the IAM user.AWS Secret Access Key
: Enter the secret key from the IAM user.Default region name
: Enter your preferred AWS region (e.g.,us-west-2
).Default output format
: Enter your preferred output format (e.g.,json
).
[Add Image]
4. Verification:
To ensure your AWS CLI is set up correctly, run:
aws sts get-caller-identity