AWS CLI Infrastructure and Using CMD to launch and manage Instances

Here, in this post, I'll let you know how to use aws-cli to launch and manage AWS services with very ease.

Today, I will demonstrate how to do the following things:

1: Creating a key-pair

2: Creating a security-group

3: Launching an instance

4: Creating a Volume(EBS)

5: Attaching the EBS Volume to our AWS Instance


So Let's get started...

First of all you have to download and install aws-cli program in your computer.(NOTE: the link is for Windows OS only, you can search for other OS over the internet)

Now that you have aws-cli program in your computer, open cmd and run the command "aws" and you will get the screen something like this...

No alt text provided for this image

This means, that aws-cli is installed properly on your device. Now you have to configure your aws-cli, i.e., you have to login to your IAM role. After you login, we'll continue.

1: Creating a Key-Pair: You have to run the following command to create a key-pair

command: aws ec2 create-key-pay --key-name <keyname>

d

Confirming if the Keypair is created successfully using webUI

No alt text provided for this image

2: Creating a Security-Group:

command: aws ec2 create-security-group --group-name <groupname> --description <"description">

No alt text provided for this image

Confirming if the Security Group is created successfully using webUI

No alt text provided for this image

3: Launching an Instance with the above created key-pair and security-group:

command: aws ec2 run-instances --image-id <image-id> --instance-type <instance-type>--key-name <yourkeyname> --security-groups <your-security-groupname>

No alt text provided for this image

Confirming if the Instance is launched successfully using webUI

No alt text provided for this image

4: Creating a Volume(EBS):

command: aws ec2 create-volume --availability-zone <region/AZ-name> --size <inGB>

No alt text provided for this image
No alt text provided for this image

As you can see, the EBS volume is created. Don't confuse with the name "using-cli", I have given that name in the webUI itself so that we can easily identify.

Finally, now we will attach this EBS volume to our instance

  • 5: Attaching the EBS Volume:AWS CLI Infrastructure and Using CMD to launch and manage Instances

For this you need to have your Volume ID, the Instance ID(because you need to confirm which instance you are going to attach this volume).

command: aws ec2 attach-volume --volume-id <yourVolumeID> --instance-id <yourInstanceID> --device /dev/xvda

No alt text provided for this image

Finally, we have learnt how to use aws-cli infrastructure and got to know how we can easily launch or manage services from AWS with the power of Command Line(and ofcourse that's what Computer Geeks use xD).

要查看或添加评论,请登录

Charan V.的更多文章

  • K Means Clustering UseCases in Security Domain

    K Means Clustering UseCases in Security Domain

    Introduction K Means Clustering is an Unsupervised Machine Learning. It is one of the simplest and popular unsupervised…

  • Deploying a ML model inside Docker

    Deploying a ML model inside Docker

    In this blog, we'll be talking about deploying a trained Machine Learning Model inside a Docker Container. So, for…

    2 条评论
  • Integrating LVM with Hadoop

    Integrating LVM with Hadoop

    Hey Everyone, in this article we will learn how we can provide elasticity to our datanode's storage. First of all, we…

  • 1: Configuring the Webserver On a Docker Container

    1: Configuring the Webserver On a Docker Container

    In this article, we will be discussing about how to install and configure HTTPD WebServer on a Docker Container Image…

  • A Network Setup, Ping ONE but not the OTHER

    A Network Setup, Ping ONE but not the OTHER

    Hello Everyone, In this Article, we will setup a network such that it will ping to Google servers, but it will not ping…

  • What is BigData in Layman's Language

    What is BigData in Layman's Language

    BigData Problem Hey Everyone.! So I've just started a research on data like how much data does same company works per…

社区洞察

其他会员也浏览了