HOW TO ACCESS AWS USING CLI

TASK DESCRIPTION

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.

All the above steps must be performed using AWS CLI

INTRODUCTION

🤔What is AWS CLI?

AWS CLI is a tool that pulls all the AWS services together in one central console, giving you easy control of multiple AWS services with a single tool. The acronym stands for Amazon Web Services Command Line Interface because, as its name suggests, users operate it from the command line. With it, you can control services manually or automate them with powerful scripts.

📝How It Works ?

AWS is a secure cloud services platform that offers computing power, content delivery, database storage, and other infrastructure services for developers. Proponents point to its speed, flexible pricing, exemplary customer service, and a huge variety of services as benefits. The AWS CLI puts the icing on the cake by tying control of all those services together into one simple command line interface. It cuts out the user-friendly (but time-consuming, according to some) step of interacting with the system through a Graphical User Interface (GUI).

How to Install AWS CLI

You can install the tool by downloading it from the AWS CLI resource page at Amazon. The page has download options for Windows, Mac, and Linux installations. It also has a beginner’s guide, a comprehensive reference manual, a user forum and a link to the GitHub project. Here are the install tools offered by Amazon:

by using aws — version we confirm that AWS CLI is installed in our base os

1) Configure AWS

Let’s we start task practical

Now first give AWS credentials, for this we need Access key & Secret key for configure AWS and these will get while creating an IAM User in AWS.

COMMAND:- aws configure to check whether we log in or not , here i am successfully login

2)Create a key pair

Creating private key to connect with the ec2 instance .

for creating new pair key use below command :-

aws ec2 create-key-pair — key-name <key_name>

new key pair has been create
IN GUI

3)Create a security group

  • To create a security group use below command :-

aws ec2 create-security-group — description <“description”> — group-name <“group_name”>

security group successfully create & group id come up as output
IN GUI

3)Launch an instance using the above created key pair and security group

Launch a new EC2 Instance using above created key pair & security group.

Launch EC2 Instance using below command :-

aws ec2 run-instances — image-id ami-0e306788ff2473ccb — instance-type t2.micro — count 1 — subnet-id subnet-35b4df79 — security-group-id sg-032703f3eb123837d — key-name firstkey

Now new instance is created
Here you can see that new instance has created.

4)Create an EBS volume of 1 GB

Now we create New EBS VOLUME OF 1 GB

BY USING BELOW COMMAND

aws ec2 create-volume — availability-zone “ap-south-1” — size 1

New EBS VOLUME has created
IN GUI

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

Now attach the EBS VOLUME to the INSTANCE by using below command :-

aws ec2 attach-volume — device “xvdb” — volume-id “vol-063d19ea577bb4c3e” — instance-id “i-0ca573d49cad9859a”

Now we attach EBS VOLUME to the INSTANCE

Getting full information about EC2 Instances use below command :-

aws ec2 describe-instances

--

--

--

I am an IT Enthusiast, who is passionate about exploring/learn all the latest technologies from research perspective.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

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
Jatin Lodhi

Jatin Lodhi

I am an IT Enthusiast, who is passionate about exploring/learn all the latest technologies from research perspective.

More from Medium