Step 1: Download the aws cli installer package file
Download it via following link: https://awscli.amazonaws.com/AWSCLIV2.pkg.
The installation of aws cli will be done at the following location:
The installer will automatically create a symlink at following path:
Run the following command to further command the location of installation:
That will give you the following output: /usr/local/bin/aws
Step 2: Configure AWS CLI
Before moving ahead with AWS CLI configuration, make sure you have the following keys with you:
- AWS Access Key ID: <Your IAM user AWS Access Key ID>
- AWS Secret Access Key: <Your IAM user AWS Secret Access Key>
- Default region name: <Your AWS region, like us-east-1>
Run the following command to configure aws cli:
Enter the values asked by aws cli prompt, example:
AWS Access Key ID [None]: AWEDSFUAQN7DQGHU6E4U AWS Secret Access Key [None]: AERT/lnQpERFSSYLQ7ERT Default region name [None]: us-east-1 Default output format [None]: json
The AWS Access Key ID and AWS Secret Access Key will be different for your IAM user with which you want to login into AWS CLI.
The configure command will create a new folder at the following location:
That folder will contain the following two files:
Verify the content of those two files. The config will have the text like this:
[default] region = us-east-1 output = json
and the credentials file will have your keys:
[default] aws_access_key_id = AWEDSFUAQN7DQGHU6E4U aws_secret_access_key = AERT/lnQpERFSSYLQ7ERT
Run any aws command against aws to verify that the set up was done correctly, you can run the following command :
aws s3 ls s3://YOUR_BUCKET
Put any bucket path in place of YOUR_BUCKET in the above command. If it gives you the list of files that means the set up was done correctly.