Let’s Work on AWS CLI To Being Faster

Sweta Sardar
6 min readOct 14, 2020

--

🔹As the pure Technical guy/Programmers/Developers used to works on CLI(Command Line Interface) because you know in GUI(Graphical User Interface) there is lots of option available and we have to choose again and again and again, and you know how it’s irritating just like feels it extends our 1 min of working into 5 mins.

🔹Most of the things like what we see in Graphically it looks like very easy and pretty must be sure, but the way it is structured, designed and be created how we came to know that what is happening behind the scene until we don’t go into the depth.

🔹In AWS CLI we can do every instruction and most of the practical very successfully and quickly with multiple task at a time means “in one single line of code we can successfully done our requirement” , which we can’t able to do properly by Graphical because there is some restriction in by doing the things in Graphical Interface.

🔹So don’t be afraid of black screen, let’s move towards to the step one and believe me once you start working on CLI you automatically come to know that how quickly you can complete your all work using CLI.

First thing we have required to install the AWS CLI Software

We can find the software by following these simple steps :

  1. Search on Google- “AWS CLI install” then click on that link.

2. Now click on this link for download the software.

https://awscli.amazonaws.com/AWSCLIV2.msi

3. Then install the software easily. After installing the software we check it is successfully installed or not by typing this commands :

#aws --version

Now we have done all the set-up successfully, let’s moves towards and do one task on AWS CLI :

Task Description — AWS 👨🏻‍💻

🔅 Create a key pair

🔅 Create a security group

🔅 Launch an instance using the above created key pair and security group.

🔅 Create an EBS volume of 1 GB.

🔅 The final step is to attach the above created EBS volume to the instance you created in the previous steps.

First thing you have to know only the right approach and clear about the all concepts, just these things required and nothing special, then we can do implement about any of the task or problem can solve it by ourselves.

So let’s start the TASK on AWS CLI

🔹So first we have to login the AWS Account and create IAM User and give them Programmatic access type.

🔹After that we get AWS Access key ID and AWS Secret Access Key.

🔹Now by getting this AWS Access key ID and AWS Secret Access Key we have to Authenticate our Account.

By this command : #aws configure

We have configured successfully

🔅 Now let’s see how to create a key pair :

🔹By “help” command we can find our approach that what we have required to do after that.

command : #aws ec2 create-key-pair help

🔹Now we have successfully created our key pair by using this commands :

command : #aws ec2 create-key-pair — key-name <value>

Let’s check on AWS CONSOLE it is created or not ?

🔅Now we create a security group by same approach using help command we able to create a security group :

command : #aws ec2 create-security-group — group-name <value> — description <value>

Let’s check on AWS CONSOLE it is created or not ?

🔅 Now let’s launch an instance using the above created key pair and security group :

command : #aws ec2 run-instances help- This “help” command helps us to give some hints which after that what command we should have to run and about which format.

command : #aws ec2 run-instances — image-id <value> — instance-type <value> — count 1 — subnet-id subnet <value> — security-group-ids <value> — key-name <value>

🔹Now we have successfully launched our AWS EC2 Instance :

Let’s see on AWS CONSOLE our instance is launched or not ?

It is successfully launched

🔅 Now we create an EBS volume of 1 GB :

command : #aws ec2 create-volume — volume-type <value> — size <value> — availability-zone <value>

Let’s check on AWS CONSOLE our EBS volume is created or not ?

Our 1 GB of EBS volume is created successfully

🔅Now we attach the above created 1 GB of EBS volume to the AWS EC2 Instance :

command : #aws ec2 attach-volume — instance-id <value> — volume-id <value> — device <value>

Let’s check on AWS CONSOLE our EBS volume is attached or not ?

It is attached successfully

Now we can detach also by this commands :

command : #aws ec2 attach-volume — instance-id i-096aa9e11a21b58e3 — volume-id vol-0fbc59c64c7e6b036 — device dev/xvdf

Let’s see on AWS CONSOLE our EBS volume is detached or not?

It is detached successfully

And here our requirement is finished up So I’m stopping my instance from AWS CLI, So here the last thing I’m going to show you how we can do this :

🔹Get the command from help command :

command : #aws ec2 stop-instances help

🔹Now run this commands :

command : #aws ec2 stop-instances — instance-id <value>

Let’s check on AWS CONSOLE should we successfully done all the above things ?? I guess yes !! let’s visit once 🙃🙃🙃

Our instance is successfully stopped

🔹 First Know your requirement then do your implement 🔹

🔹 !! HAPPY LEARNING !! 🔹

🔹 THANK YOU 🔹

--

--

Sweta Sardar
Sweta Sardar

No responses yet