Introduction
So this blog is about how you can setUp AWS CLI in your Windows, Mac, Linus operating system.
AWS CLI Setup
- Windows
- Download the AWS CLI installer.
- Follow the instruction that appears and Finish your installation.
- Restart your system, to get your changes reflected.
- 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.
- 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]:
- To get your AWS Access Key, Login to your AWS account, go to IAM --> Rotate your Access Keys --> Manage User Access keys --> Security Credentials
- In case if you don't remember your AWS Secret Access Key then, delete your current access key and generate a new one.
- Your final configuration will look like -
- 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.
- macOS & Linux
- Check your Python version using your Terminal using $ python --version
- If your computer doesn't have python installed or the version is 2.6.3 or before, please go ahead and install python
- 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
Post a Comment