How to setup AWS CLI.
In this blog guys I am gonna show you how you can setup AWS cli for all your access.
To setup a AWS CLI we need to have following:-
- An AWS account with owner access.
- An AWS CLI installer.
Let’s start setting up the AWS CLI.
First login to your AWS account (management console) and click on the IAM services Security, Identity, & Compliance.
After reaching to IAM users page click on the add user tab and fill the details as follow —
- Choose programmatic access for getting access key ID (It is like username) and secret access key(It acts like password).
- On clicking next, you have to select permissions you want to give to the new user. Here you can create a user with permissions and without permissions but it is always good to limit the IAM user with certain permissions.
- You can set up permissions through adding user to group, copying existing permissions from previous users, and attaching existing policies.
- Here I am giving PowerUserAccess policy to my user, So this user can do everything in AWS except changing or accessing the billing menu.
- Next you have to add tags, skip it for now.
- Next you have to review this user and after reviewing click on next and your user will create.
- You will see an access key ID and a secret key on last page. Copy this ID’s into a secure file.
Now our user has been created, Time to launch instances from CLI, before continuing to CLI we have to download a CLI installer.
You can download the installer from here:
After downloading the above file just double click on it and click on next , after clicking next next your CLI will install.
After installing the above installer launch your cmd. run aws version command to check successful installation of AWS CLI. If you see result like below than your CLI has been installed successfully.
Now we have to login with the access key and secret key we have created previously.
Type the following command to login in AWS CLI.
After entering the command it will ask you for the access key id and secret key ID enter both to continue.
After entering the above key’s it will ask you for your preferred zone, I am using ap-south-1 which is mumbai, you can use whichever close to you.
After entering zone it will ask you for your default output format, I am choosing default format which is JSON you can choose according to your preference.
Now your CLI has been set up successfully. you can use the same for doing anything or everything in AWS without login to your console.
To check more usage of CLI you can check my blogs Abhisheksahu
Thanks for reading this complete blog, Hope you find it useful…