Automation in AWS |CLI | TASK-3 | AWS-CSA | ARTH

Hey Guys !!!

So in Technical world Automation is necessary, it require minimum human assistance. In manual we need to do every thing by ourself.

As we know for launching an AWS Instance we have to pass 7 pages and have to do lot of clicks, it takes more time & in technical world we don’t much time. But in CLI same thing we can do in one command & one enter.

In AWS we have ways to login into their services:-
1.WebUI: Manual

2.CLI: Automation

3.SDK i.e. Using some programming language.

In techincal world we use WebUI but we can’t do much thing using WebUI so we use CLI coz it provide more features than WebUI.

One more thing, In WebUI if some process fail we can’t the reason why it fail. But CLI have ability to find the reason of this error & we can also Troubleshoot the error.

So before doing anything we have download & install AWS command in our PC. Link to download AWS command is given below:-

https://awscli.amazonaws.com/AWSCLIV2.msi

So we have downloaded & installed AWS command Now can move login part. So login we need Access Key & Secret Key and to get these key first we have to create an IAM user.

Here i created IAM user, in step-1 Access type we have to click on Programmatic Access.

We can extract our Access key & Secret key in Step-4. We can also download a text file with Access key & Secret key.

Login:- To login use the below commands:-

After pre-requisites let move to task.

Task discription :-

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 the practical part.

Step1 : To Create a key pair I use given command

Screenshot of CLI
Screenshot of WebUI

We can see in WebUI that a key-pair with name gsarth123 is created.

Step2 : To Create a security group I used the given command

Screenshot of CLI
Screenshot of WebUI

Here we can see a Security group with name artht3sg is created.

Step3 : Before launching the instance we need to the security group ids, we can use the given command for this

To Launch an instance the command I used is

Screenshot of CLI
Screenshot of WebUI

We can also see in WebUI an OS with arth-OS name.

Screenshot of WebUI
Screenshot of WebUI

Here we can see the attached Key-pair & Security Group which we have created in previous step.

Step4 : To Create an EBS volume of 1 GB the command I use is

Screenshot of CLI
Screenshot of WebUI

We can also confirm tthrough WebUI a Volume with name art-vol of size 1 GB.

Step6 : To attach the above created EBS volume to the instance command I used is

We can find Volume ID & Instance ID using given command

Screenshot of CLI
Screenshot of WebUI

Here we can that our volume arth-vol is attached to our instace arth-OS which we have created in previous steps.

So, finally all steps of the Task is completed.

““““““Thanks For Reading the Blog””””

student