Control EC2 Service Using CLI

Control EC2 Service Using CLI

In this task, we are going to perform the following:

  • Create a Key Pair
  • Create a Security Group
  • Launch an instance using these Key Pair and Security Group
  • Create an EBS volume of 1 GB
  • Attach this volume to the instance that we have created

Step-1: First we have to install the AWS CLI version 2, we can use the following link to download this for windows: AWS CLI V2

For Linux use this command: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

For MAC: AWS CLI V2 macOS

We can check that AWS installed or not by the following command

aws --version

Step-2: Configuration of AWS CLI

  • First, we have to create an IAM user
No alt text provided for this image
  • Now we have to give permission to this user. In my case, I give Administration Power to my user.
No alt text provided for this image
  • Now finally, we get the Access Key and Secret Key.
No alt text provided for this image
  • After this, we need to configure our AWS CLI using the CMD line. For this, we have to provide the Access Key and Secret Key
No alt text provided for this image

Now, we are good to go.

Step-3: Create a New Key Pair

No alt text provided for this image

We successfully created a private Key to launch our instance.

Step-4: Create a New Security Group

No alt text provided for this image

Now, we are ready to launch the instance using these Key Pair and Security Group. We use this Security Group in our instance.

Step-5: Launch the Instance

  • We use the following command to launch the instance
No alt text provided for this image
  • By providing these details we can launce the instance and we get the instance id
No alt text provided for this image
  • We can also cross-check that the instance is created or not using GUI
No alt text provided for this image

Here, we can see our instance is running successfully.

Step-6: Create an EBS volume of 1 GB

  • Now, we are going to create an EBS volume, to attach it with the instance, both instance and volume should be in the same Region. We can create volume by the following command
No alt text provided for this image

Here, we can see that we successfully created the volume and we also get the volume id.

  • We can also cross-check by GUI that it is created or not
No alt text provided for this image

Step-7: Now, in this final step, we are going to attach this volume to the EC2 instance that we have created past

No alt text provided for this image

BINGO!!!!

See, we successfully attach the volume to the instance.

  • We can check it from GUI also
No alt text provided for this image

Here, we can see that our newly created volume 'in use' right now.


THAT'S IT...

THANKS FOR READING THIS!!!

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

Hemendra Chaudhary的更多文章

  • Industry use cases of Jenkins

    Industry use cases of Jenkins

    What is Jenkins? Jenkins? is an open-source automation server. With Jenkins, organizations can accelerate the software…

  • The Usecase of JavaScript n industries

    The Usecase of JavaScript n industries

    What is Javascript? JavaScript is a lightweight, open-source and cross-platform programming. It is designed for…

  • K-Means Clustering and UseCases in Security Domain.

    K-Means Clustering and UseCases in Security Domain.

    K means is one of the most popular Unsupervised Machine Learning Algorithms Used for Solving Classification Problems. K…

  • Confusion Matrix And Cyber Crime

    Confusion Matrix And Cyber Crime

    What is Confusion Matrix? When we get the data, after data cleaning, pre-processing, and wrangling, the first step we…

  • Neural Networks and their Applications in Industry

    Neural Networks and their Applications in Industry

    INTRODUCTION Over the past few years, technology has become very dynamic. It is fuelling itself at an ever-increasing…

  • Integrating LVM with Hadoop and providing Elasticity to DataNode Storage

    Integrating LVM with Hadoop and providing Elasticity to DataNode Storage

    To understand the term 'Big Data', we first need to understand "What is data?". So, Data are a collection of facts…

  • USE-CASE FOR KUBERNETES

    USE-CASE FOR KUBERNETES

    Introduction Kubernetes is a powerful open-source system, initially developed by Google, for managing containerized…

  • Ansible: How industries are solving challenges using Ansible

    Ansible: How industries are solving challenges using Ansible

    In this article, we come to know about: What is Ansible Architecture of Ansible Ansible: Concept Why we need Ansible…

  • Use Case Of ML/AI In Agriculture

    Use Case Of ML/AI In Agriculture

    Artificial Intelligence(AI) refers to the simulation of human intelligence in machines that are programmed to think…

  • Case Studies - Cloud Computing

    Case Studies - Cloud Computing

    An introduction to cloud computing right from the basics What is cloud computing, in simple terms? Cloud computing is…

    1 条评论

社区洞察

其他会员也浏览了