Use AWS-CLI to create the EBS volume and attach to instance

In this article, I am gonna implement AWS-CLI to perform some task.

Task Description →

🔅 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.

So Lets start:

Step1 — >

Create a IAM user in AWS console.

For that, Go to AWS console, then go on IAM Management Console

Locate the Users Tab navigate on it.

Click on Add User. Then in User Name field, add the name of user you want to add. And forgot to select the Programmatic access option. Click on next option.

For the User to be created, we need to set permissions for security reasons.

So search for PowerUserAccess.

Note: You Can also Give AdministratorAccess

The Tags part is optional,so i haven't added any tags.

So, Review the information on this page, then click on Create User option at bottom right corner.

Now you can see that, the new user is created and you can see Access and Secret keys.

Download the .csv file keys for future reference.

Step2 →

Download and Install AWS-CLI program. Click here to download.

Step3 →

Now using the keys obtained in Step1 login to AWS in CLI.

Use # aws configure command then add Access and Secret key with default region.

Now, as per Task we need to Create a Key-Pair.

Now Create a Security Group.

To know more details of Security Group,

Launch a EC2 instance using above created Key-Pair and Security Group

Create EBS (Elastic Block Storage)

Now Final Step:

Attach the above created EBS Volume to EC2 instance using CLI.

We can see in WebUI of AWS, is it attached or not..


Also, Dont forgot to delete EBS and Instance after Use

Thanks For Reading :)




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Securing Kubernetes and Google Cloud with Workload Identity

FirebaseUI: Adding Firebase Authentication into your Android App

node-red | MQTT | Kafka

READ/DOWNLOAD![ Engineering Ethics: Concepts and C

The Force Protocol is Officially Launching Yield Farming Tomorrow

Connect to GCP Instance using a Third Party tool

Tips and resources for passing the AWS solutions architect professional Exam

AWS Certification confirmation email

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
Prajwal Patil

Prajwal Patil

More from Medium

Lets learn about USDD Stablecoin

Metaverse trends to watch in 2022

viAct at GO AUSTRIA Spring 2022 by Global Incubator Network Austria (GIN) BBL