Command AWS through CLI


It is a way, how we interact with programs. For example, In our real life, while we communicating with people, we can speak or we can convey our thoughts through symbols, similarly in electronic world we have interface where the user can interact with their systems through any one kind of interface. There are 2 prominent interface are GUI and CLI. In this new era we have 2 other interfaces, they are Web UI and Mobile UI. By this ways we can communicate with our machines and ask them to do what we want i.e. open a program, change properties, etc.

why Command Line Interface (CLI) ?

As of user concern, GUI is enough to interact with their machine. In case, you are from developer background, it is good to go with Command Line Interface. While using CLI, we will be able to understand the architect and concept of a program or any other technology more keenly. CLI approach will let us know the correct flow for any technology.

So, to know more clearly about AWS and its Services, we are going how to see how to use AWS in CLI.

To run any command in CLI, we need to install appropriate program. so we need to install AWS CLI program.

For windows user —

using this link, you can install AWS CLI program. You can also find this program for different OS.

After installing the program, you can check using the following command

you will be getting version details of the program. It tells that the program is installed properly.

Task to be performed using CLI are:

🔅 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.

Create a key pair:

Before going to create key pair, we have to configure the AWS account’s user in CLI. To do that we want to create IAM user in AWS, to use all services we are giving that user an Administrator Access, this access gives user all power except access to billing.

Go to:

Step 1: click add user

Step 2: Type the user name

Step 3: check in the programmatic access and other check in box is optional, but checking in programmatic access is needed to access the AWS through CLI and click Next.

Step 4: choose attach existing policies directly and choose Administrator Access to get user to access AWS account and access all the services except billing and click Next.

Step 5: Add tags related to user and click Next for review

Step 6: Check for the details and click create user

Step 7: IAM user is created

Configuring the AWS user in CLI

Type the user’s credentials and type the region. In above case, we have already configured created user

now we can create key pair,

Create a Security Group

It help to allow the restricted IP and port to access the data. It helps to enhance the security of an instance. There two things, they are inbound and outbound. Inbound is related to traffic to the instances and outbound is related to traffic for other instances or machines.

To add rule

To see details of Security Groups:

Creating an instance using created key pair and security group:

Ec2 is computing service, which is used to create instance. This provide computing power to the instance.

here I use rhel8 image,

creating EBS volume

It is similar to pen drive or portable hard disk which we use as secondary storage devices. It keeps the data persistent and easy for portability between the two or many instances created in cloud.

Attaching EBS Volume to the created Instances

Now, it becomes easy start AWS with CLI

note: Don’t feel hard to remember the command, use help command.

#awscloud #awscli #aws #vimaldaga #righteducation #educationredefine #rightmentor #worldrecordholder #linuxworld #makingindiafutureready #righeudcation #arthbylw #awsbylw

learning things that never get exhausted

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