Getting started with AWS CLI…..

No doubt we started using AWS services with Web-UI,It‘s quite easy to go through various services and access the same.

But,if it can be done by Command Line Interface?

Yes ! we can manage the AWS services using Command Line Interface. We have provision of AWS CLI with the application which we have to install on our device.

🟣Setting Up User-Account:
Setup IAM configuration by adding user in AWS and get Access Key,Secret Key and in Command Prompt of Windows / Linux ,
Type command: aws configure
Insert Access key as well as Secret Key ,
Setup region
And here we go ✈….

🟣New to AWS CLI ?
Don’t worry we can lookup documentation or we have the help option in AWS CLI which assist us to step forward.
To use help option in AWS CLI , we have :
: aws help
OR : aws <servicename> help
OR : aws <servicename> <service_attribute> help
We will see this in more detail below.

Demonstration of help option

🟣Deep diving in AWS :
If we want to check how many instances are running in our EC2 service,
We have command : aws ec2 describe-instances
This will show you all the instances running which will be output in JSON format.

🟣Can we launch instance using CLI ? Yes we can !
Lets see how !
To launch instance we use command :
:aws ec2 run-instances — image-id ami-xxxxxxxxx — count 1 — instance-type t2.micro — key-name Mykey — security-group-ids sg-xxxxxx — subnet-id subnet-xxxxxx

AWS_CLI instance launched from CLI

🟣Similarly a Key-pair can be created :
To create a new key pair:
:aws create-key-pair — key-name <key_name>

Help option for ec2 service to create key-pair
Created new key-pair Mykey .

🟣Is it feasible to configure a new Security Group ? Yes why not!
To create Security Group: aws ec2 create-security-group — group-name <Security-Group name> — description “<description of key>”

Help option to create-security-group
created security group
Mykey Security Group created

🟣Can we create an EBS volume ?
To create an EBS volume : aws ec2 create-volume — volume-type <bydefault-(gp2)> — size <value> — availability-zone <zone_name>

Help option for EBS
New volume of gp2 type
AWS_VOLUME created.

🟣What if we want to attach the same block storage to previously launched instance?
To attach EBS volume :
:aws ec2 attach-volume — volume-id <vol-xxxxxxx> — instance-id <i-xxxxxxxx> — device <(say)/dev/sdfg>

Help option to attach volume to an instance
Volume attached to an instance
Volume is attached to AWS_NEW_CLI

Thus , CLI is most powerfull tool we can ponder upon…….
It cover-up all the limitations that Web-UI has.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Technological Enthusiast , Like to express what is need of time, Relates real world to philosophical insights