AWS CLI Installation | Amazon Web Services

Introduction


AWS CLI is basically to manage your AWS from the terminal or command prompt session. So once you get your AWS account ready you will feel very comfortable clicking through all services. But there is little more about this and it's time to check out the AWS CLI (Command Line Interface).

So this blog is about how you can setUp AWS CLI in your Windows, Mac, Linus operating system.


AWS CLI Setup

  • Windows    

    1. Download the AWS CLI installer.
    2. Follow the instruction that appears and Finish your installation.
    3. Restart your system, to get your changes reflected.
    4. Usually, a path where CLI gets installed is -
      • 32 bit - C:\Program Files (x86)\Amazon\AWSCLI
      • 64 bit - C:\Program Files\Amazon\AWSCLI
            
            Once the installation is done, you can check your aws version and start configuring.
      • Open your command prompt and type aws --version to check installed version.
                                
AWSCLI_Version
          
      • Now configure your local with aws account. Type aws configure you will get four options like -               
AWS Access Key ID [None ]:
AWS Secret Access Key [None ]:
Default region name [None]:
Default output format [None]:


AWSCLI_Configure

      • To get your AWS Access Key, Login to your AWS account, go to IAM --> Rotate your Access Keys --> Manage User Access keys -->   Security Credentials 

AWSCLI_IAM1


AWSCLI_IAM2

      • In case if you don't remember your AWS Secret Access Key then, delete your current access key and generate a new one.    

AWSCLI_IAM3


AWSCLI_IAM4

      • Your final configuration will look like -
AWSCLI_FinalConfigure

      • To test things are working or not try executing aws s3 ls This will list out all s3 buckets in your aws account for the specific region.
AWSCLI_S3Command



  • macOS & Linux    

    1. Check your Python version using your Terminal using $ python --version 
    2. If your computer doesn't have python installed or the version is 2.6.3 or before, please go ahead and install python
    3. Please follow the below steps and execute those in your terminal
      • $ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
      • $ unzip awscli-bundle.zip
      • $ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
                    Now you need to add your Secret Access Key and Access Key ID to ~/.aws/config  as -

[default]
 
aws_access_key_id = <access key id>
aws_secret_access_key = <secret access key>
region = <us-east-1>
            Note:  In the Windows section, I have explained how you can get your Secret Access Key and Access Key ID from the AWS account.

      • Now protect the file executing chmod 600 ~/.aws/config
      • To test things are working or not try executing aws s3 ls This will list out all s3 buckets in your aws account for the specific region.



Thank you, Please comment your inputs and keep following our blogs.












Comments