WORKING ON AWS CLI

WORKING ON AWS CLI

ABOUT AWS CLI

THE AWS COMMAND LINE INTERFACE (CLI) is tool to manage aws services. AWS provide the storage and functionally to improve our business scale and grow. we launch the instance without using WEBUI.

AWS CLI support a wide range of terminal program in command prompt like bash, zsh, tchs, window cmd window power shell and lots of as well.

INSTALLING AWS CLI IN ANY OPERATING SYSTEM

We need to install the software awscli

https://awscli.amazonaws.com/AWSCLIV2.msi download this software

To check awscli install or not in cmd

aws --version


No alt text provided for this image

get access key and secret key from IAM ->user->power access

qrr3


After installation we have to need configure our cli using

  1. access key -> its like user id but not same
  2. secret key-> its like a password
  3. default region name ->ap-south-1
  4. default output formate-> json
aws configure
No alt text provided for this image

Need to create access key key pair

aws ec2 create-key-pair --key-name arth_task

No alt text provided for this image

if we want to check in webui then aws->key-pair

No alt text provided for this image


if we have already key-pair then this command has to be used

aws ec2 describe-key-pair
No alt text provided for this image

Now we need to security group in ec2 instance

aws ec2 create-security-group --description "arth_task_security" --group-name arth_task

in awscli

No alt text provided for this image
aws ec2 describe-security-groups --group-id sg-0cfd652eecdab47e4
No alt text provided for this image


check on webui

No alt text provided for this image

Let's launch the ec2 instances we use above security group

aws ec2 describe-instances


No alt text provided for this image

launch ec2 instances

aws ec2 run-instances --image-id ami-052c08d70def0ac62 --instance-type t2.micro --count 1 --subnet-id subnet-6a272e02 --security-group-ids sg-024b9fb54a114d605 --key-name arth_task
No alt text provided for this image

now check instance launch or not in webui

No alt text provided for this image

If we want to stop the instances the this command is to be used

aws ec2 stop-instances --instances-ids INSTANCE ID

CREATE EBS VOLUME USING AWSCLI

If we need the ebs volume we have to need availability zone or data center and volume type

aws ec2 create-volume --availability-zone ap-south-1a --size 1
No alt text provided for this image

check on webui create ebs volume or not

No alt text provided for this image

Attaching ebs volume with ec2 instances

aws ec2 attach-volume --device xvdb --instance-id i-0c26836d88df63079 --volume-id vol-002d40d9942517222
No alt text provided for this image

check on webui

No alt text provided for this image

If we want to disconnect the ebs volume

aws ec2 detach-volume -volume-id Volume-ID

THANK YOU(in brief) about awscli


To view or add a comment, sign in

More articles by Santosh Yadav

  • WHY AWS IS BETTER THAN OTHER SERVICE PROVIDER

    AWS(AMAZON WEB SERVICE):---> Aws is cloud computing platform which provide services such as compute power, data base…

  • BIG DATA

    Big data is not a new technology not any kind of software just it a problem or may be we can say beyond the capacity in…

Others also viewed

Explore content categories