What is the Command-line interface (CLI) and AWS (CLI)?

A command-line interface processes commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-line processor. Similarly, The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

Why we use AWS CLI?

AWS CLI gives you the ability to automate the entire process of controlling and managing AWS services through scripts. These scripts make it easy for users to fully automate cloud infrastructure. Prior to AWS CLI, users needed a dedicated CLI tool for just the EC2 service.

  1. Launching an instance using the above created key pair and security group.
  2. How we can create an EBS volume of 1 GB.
  3. The final step is to attach the above created EBS volume to the instance we created in the previous steps.

Prerequisites for this task

  1. Installed AWS version 2 on your os. If not use this link to download https://awscli.amazonaws.com/AWSCLIV2.msi
  2. An AWS account.

ALl of the first we have to create IAM user

To create an access key for an IAM user

1. Sign in to the AWS Management Console and open the IAM console

We have successfully created a user.

Now we will use command

aws configure

Now to create a key pair we use command

aws ec2 help

after running this command we have to search command to create security group

After security we have to give inbounb rules

For Launching Ec2 we will use command -

Now we will creat EBS of 1gb

For this also we will take help of aws documents

Now for attaching the created EBS volume we will use command -