Power of CLI for managing Instances in AWS Cloud

Anshika Sharma
4 min readMay 31, 2020

Hey guys!

As we all know that in today’s world everything is available with a Web Interface or we can say with GUI and WebUI. But still there is a different world of Developers , for them CLI is the most beautiful and very effective tool for working. So, In this story I am going to discuss a very basic power of CLI for creating Operating System (In cloud world known as Instances) on AWS Cloud.

For this , there is a prerequisite of understanding some basic concepts of AWS like EC2, EBS, VPC , Subnets, etc. For this you may refer to this blog :

Requirements for completing this practical are :

  1. AWSCLIV2 software installed in your systems
  2. AWS account for the implementation
  3. OpenSSH client configured in your systems .

So let’s start with some introduction , first of try to create an Instance by following the above link.

Now lets create a IAM user, as it a good practice for development and managing the codes as well.

  1. On the Dashboard of AWS Management console, Go to My Service Credentials

2. Create a new User (IAM USER ) and provide permissions to the user, also add tag to the user (Adding tags is optional, we may skip this part also but again its a very good practice to give tags).

3. Review all the details of the user and then create it

4. User created successfully

Now, secondly we will download and install the AWSCLIV2 software to work through CLI

  1. Download the software

2. Install the software

After successfully installing the software we will move to the OpenSSH client setup in our local system, i.e.,

Manage optional features -> OpenSSH client (It should be Installed)

As we have completed our setup, now we will start operating on AWS cloud from our local windows (through CLI) :

step 1. Checking version of AWS and configuring it

Step 2. Creating the Key pair (that is required for creating the instances further)

Step 3. Creating new instances in AWS cloud

Step 4. Verifying the Created Instance through CLI

Step 5. Describing the Instance or accessing its complete Information about it

Step 6. Describing the key pair we used in this instance

Step 7. Applying query on Instances to retrieve only the required information like only first key pair from the list of key pairs, i.e.,

Step 8. Apply query to access some specific values

Step 9. Stopping an Existing Instance, when not in use

Step 10. Starting the already created Instance when required

Step 11. Using the Instance From the CLI

Step 12. Accessing the Instance through its IP and service Information through an SSH connection

Hence we see only the basic operation through CLI but this is not the limit i.e., we have a lot of commands to work with. Even we can control our AWS cloud completely through CLI (this approach is followed by developers).

In further stories we will go through more advanced CLI commands and many interesting Facts too.

Thank you!!

--

--

Anshika Sharma

I am a tech enthusiast, researcher and work for integrations. I love to explore and learn about the new technologies and their right concepts from its core.