AWS-CLI :- Introduction to launching AWS instance via CLI

Neelaksh Singh
4 min readNov 11, 2020

--

Glimpse of 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 of the above will be done via AWS-CLI

Prerequisite

  1. Must already configured and added aws-cli software in one’s local sysytem.
  2. Configured aws with a user’s identity and secutity key.

Helpful Tip

If you get stuck anywhere while figuring out how you should write the command , you can always use the help keyword. Like =>

Creating Key-Pairs Instance

Note- Every other services must be done in the present directory , since our key-pair is stored in this folder and it’ll be accessed during launch of our instance

Creating a Security Group

Creating EBS volume

Here we will create our EBS volume in the same subnet and availability zone as our EC2 instance, since EBS is a regional service.

Creating our EC2 instance

AWS-CLI :- Introduction to launching AWS instance via CLI

Glimpse of 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 of the above will be done via AWS-CLI

Prerequisite

  1. Must already configured and added aws-cli software in one’s local sysytem.
  2. Configured aws with a user’s identity and secutity key.

Helpful Tip

If you get stuck anywhere while figuring out how you should write the command , you can always use the help keyword. Like =>

Creating Key-Pairs Instance

Note- Every other services must be done in the present directory , since our key-pair is stored in this folder and it’ll be accessed during launch of our instance

Creating a Security Group

Creating EBS volume

Here we will create our EBS volume in the same subnet and availability zone as our EC2 instance, since EBS is a regional service.

Creating our EC2 instance

Here you must be careful in stating Security-Group ID and also the Subnet ID.

Joining our EBS with our EC2 instance

Thus we have completed our Task of launching an EC2 instance with attached volume , all done via our CLI.

--

--

No responses yet