AWS CLI

AWS CLI ??

  1. (For Windows): https://awscli.amazonaws.com/AWSCLIV2.msi
  1. (For Linux): https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip
  2. (For Mac): https://awscli.amazonaws.com/AWSCLIV2.pkg

1)Login in to AWS Account

> aws configure
AWS Access Key ID [None]: *******************
AWS Secret Access Key [None]: ***************
Default region name [None]: ap-south-1
Default output format [None]: json

2) Create key-pair

> aws ec2 create-key-pair  — key-name MYKEY — query keyinfo  — output text > MYKEY.pem

3) Create security Group

>aws ec2 create-security-group — group-name MyCLiSecurityGroup — description “My security group” 
> aws ec2 authorize-security-group-ingress --group-id sg-0ac9d9eddb7112a21 --protocol all --port all --cidr 0.0.0.0/0
> aws ec2 describe-security-groups

4) Now, we have to launch an EC2 Instance using the Key-Pair and the Security Group that we have created in the above previous steps.

> aws ec2 run-instances --image-id ami-081bb417559035fe8 --instance-type t2.micro --security-group-ids  sg-0ac9d9eddb7112a21 --key-name MYKEY
> aws ec2 create-volume --availability-zone ap-south-1a --size 1
  1. Partition
  2. format
  3. mount The EBs So EBs attach with Instances
> fdisk /dev/sdf
> mkfs.ext4 /dev/sdf
> mount /dev/sdf /mydrive
> df -h

Thanks readers for reading!!!

--

--

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