USING AWS CLI FOR ATTACHING THE EBS WITH THE AWS INSTANCE

USING AWS CLI FOR ATTACHING THE EBS WITH THE AWS INSTANCE

OUR TASK:

🔅 Create a key pair

🔅 Create a security group

🔅 Launch an instance using the above created key pair and security group.

🔅 Create an EBS volume of 1 GB.

🔅 The final step is to attach the above created EBS volume to the instance you created in the previous steps.

All the steps must be performed using the AWS CLI.

Lets , start the task :

First of all we will create a key pair using the AWS CLI:

aws ec2 create-key-pair --key-name task3Key --output text > "C:/Users/milind verma/Downloads/task3Key.pem"

So here we can see that our key is created. I have saved the key into our downloads folder so that we can use it to launch instance and can go into it.

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

Now we will create the security group using the AWS CLI.

aws ec2 create-security-group --group-name task3SecurityGroup --description "Task 3 security group"

So now our security group is created

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

Now we will launch an instance using the above security group and the key pair.

No alt text provided for this image

you can see here that our instance is launched.

No alt text provided for this image

Now we will create an EBS volume using the AWS CLI.

aws ec2 create-volume  --volume-type  gp2 --size 10 --availability-zone us-west-2b

No alt text provided for this image

here our volume is created.

No alt text provided for this image

Now we will attach this volume to the instance that we have created earlier.

aws ec2 attach-volume --volume-id vol-095676f069e37f91d --instance-id i-0bb4e48cbb69f75ab --device /dev/sdf

No alt text provided for this image

Here our volume is attached to the respective instance

No alt text provided for this image

you can see that the volume is now in use for the instance.

So now to check whether the volume is attached or not , we will go inside the instance and mount it.

No alt text provided for this image

so now here you can see that we have attached the volume and it is easily accessible.

So finally our task is completed , thanks to the linuxworld and vimal sir for providing us such knowledge.






















To view or add a comment, sign in

More articles by Milind Verma

  • Red Hat OpenShift Deployment on AWS via ROSA Service

    Hello everyone, welcome to my article. In this article, I will cover: what's Red Hat OpenShift Service on AWS (ROSA)?…

    10 Comments
  • JavaScript - "An Integral Part of Modern Apps"

    Let’s see what’s so special about JavaScript, what we can achieve with it, and what other technologies play well with…

  • Cyber Crimes & Confusion Matrix

    Cybercrime is vastly growing in the world of tech today. Criminals of the World Wide Web exploit internet users’…

  • AWS S3 Multipart Uploading

    Hello Guys, I am Milind Verma and in this article I am going to show how you can perform multipart upload in the S3…

  • ARTH TASK-6

    OUR TASK: Create High Availability Architecture with AWS CLI The architecture includes- Webserver configured on EC2…

  • How Google uses Machine Learning

    Google is the master of all. It takes advantage of machine learning algorithms and provides customers with a valuable…

  • Kubernetes CASE STUDY: Pearson

    Challenge A global education company serving 75 million learners, Pearson set a goal to more than double that number…

  • Launching webserver and python using Docker Conatiner

    Our task: launching the HTTPD server over the docker container setting up the python interpreter and running python…

    2 Comments
  • Integrating LVM with Hadoop and providing Elasticity to DataNode Storage

    In this article I am going to show you , how can we integrate the Hadoop with the LVM. First we will launch 2 EC2…

    1 Comment
  • Netflix Case Study on top of AWS

    NETFLIX Netflix is an American media services provider and production company headquartered in Los Gatos, California…

Insights from the community

Others also viewed

Explore topics