Intro to AWS CLI

What is AWS CLI ?

The AWS Command Line Interface (CLI) is a unified tool for managing AWS services. With just one tool to download and configure, it enables controlling multiple AWS services from the command line and their automation through scripts.

Note : You can download it as per OS : https://aws.amazon.com/cli/

Content of this Blog

  • Creation of Key Pair
  • Creation of Security Group
  • Creation of EC2 Instance using the Key Pair and Security Group created
  • Creation of EBS Volume
  • Attachment of EBS Volume created to the EC2 Instance created

Prerequisites

First, check if AWS CLI has been successfully installed or not

Command :

Next, configuration using AWS Access Key, AWS Secret Access Key, Region Name and Output Format is performed

Command :

Creation of Key Pair

Command :

Creates an EC2 Key Pair named task_3.

Creation of Security Group

Part 1 : Creation of Security Group

Command :

Create a Security Group named task3_sg.

Part 2 : Addition of Ingress Rule

Command :

Creates an Ingress/Inbound rule and allows traffic via SSH only (TCP Port 22) and from a specified CIDR only.

Creation of EC2 Instance using the Key Pair and Security Group created

Command :

Creates an EC2 Instance using Image, Instance Type, Subnet , Security Group, Key and Tag specified.

Creation of EBS Volume

Command :

Creates an EBS Volume in the availability zone “ap-south-1a” and of size 1 GiB.

Note: The EBS Volume should be created in the same availability zone as of the EC2 Instance to which it would be attached as EBS is a Zonal Service.

Attachment of EBS Volume created to the EC2 Instance created

Command :

Attaches the EBS Volume of ID specified to the EC2 Instance whose ID is specified (Both of them should be in same availability zone).

Thank You !!!

LinkedIn URL : https://www.linkedin.com/in/satyam-singh-95a266182