CLI managing instances in AWS

In this blog, we will be managing AWS EC2 instances through AWS CLI. Things that will do here are creating a key pair, security group, launching an instance using the created key pair and security group, creating an EBS volume, and then in last attaching the EBS volume to the instance which is created recently.
SO the pre-requisites here are:
- AWS account for the implementation
- OpenSSH client configured in the system
Now moving to the practical:
STEP 1: Creating an IAM user
To create the IAM user, first, go to IAM dashboard in AWS then rest is shown in images.

On the left of the IAM dashboard select Users and select Add user.

Add details.

Add Permissions that you want to give to the user.

Add tags.

In last, review and create user.

After this download and install AWS CLI to work on it.
STEP 2: Creating Keypair

A key will be generated.
STEP 3: Creating a Security group


A security group will be generated.
STEP 4: Creating an instance and adding tags

Note down the instance id, availability zone from the above step as it will be used further.

STEP 5: Creating an EBS volume

Note down the volume id from the above step as it will be used further.
STEP 6: Attaching the EBS volume to the instance created

Hence it’s complete.
Hope this blog helped you for managing instance using AWS CLI.