Manipulating AWS EC2 Services using Command Line

Parth Patel
3 min readOct 13, 2020

Task :-

  1. Create a key pair
  2. Create a security group
  3. Launch an instance using the above created key pair and security group
  4. Create an EBS volume of 1 GB.
  5. The final step is to attach the above created EBS volume to the instance you created in the previous steps.

Lets Go ,

What is AWS?

Amazon Web Services (AWS) is a secure cloud services platform, offering to compute power, database storage, content delivery, and other functionality to help businesses scale and grow. Running web and application servers in the cloud to host dynamic websites.

Since we know that AWS is a technology and to use any technology like AWS, we have three ways:

  • Using WebUI
  • Through a program/code
  • Using CLI (Command Line Interface)

In this article, I will be performing each and every step using the AWS CLI.

Step 1 :- Download and install AWS CLI program

use link :- https://awscli.amazonaws.com/AWSCLIV2.msi

Step 2 :- Now login to AWS using “aws configure” command and provide access key, secret key and selecting region

Step 3 :- Creating a Key-Pair, using command :

Key pair is successfully created :-

Step 4 :- Creating Security Group :

Note:- While Creating Security Group, description of security group is necessary to provide. Else Error will occur

Security Group is successfully created :-

Here, No Rules are created.

Step 5 :- Creating Inbound Rules

Inbound Rule is successfully created :-

Step 6 :- Launching Instance using same key-pair and security group we have created

Note: If we do not provide the Security Group, it will use the default security group. The same will be used for the default Instance Type: m1.small. And, it will also pick the default VPC as well.

Instance has been launched successfully :-

Step 7 :- Creating Volume of 1 GB :

Volume is successfully created :-

Step 8 :- Attaching this volume to the previously created Instance

Volume is successfully Attached :-

And the given task is successfully completed.

Hope, You understood the Task

--

--

Parth Patel

ARTH Learner | Bigdata — Hadoop | Linux | Front-End Developer | Flask | Coding Enthusiast | Python | AWS | Ansible | Kubernetes