AWS CLI Management

AWS CLI Management

Hello everyone in the given task we are using AWS using CLI

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.

At first we have to download and install the AWS CLI Tool in our OS

No alt text provided for this image

Using aws we have to first configure it using the access key and secret key

No alt text provided for this image

if there is any keyword we not known we can take the help of help command :

aws ec2 help

Then we have to create a key pair in ec2

for creating a key pair we use the command :

aws ec2 create-key-pair --key-name awsclikey

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

Now we have to create a security group

for creating a security group we use the command :

aws ec2 create-security-group --group-name "clisecurity" --description "My CLI Security Group"

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

In the next step we have to launch an instance using the above created key pair and security group

for creating an instance we use the command :

aws ec2 run-instances --image-id ami-0e306788ff2473ccb --count 1 --instance-type t2.micro --key-name awsclikey --security-group-ids sg-0fd705b178b6ece68

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

Now we have to create an EBS volume of 1 GB.

for creating a volume we use the command :

aws ec2 create-volume --size 1 --volume-type gp2 --availability-zone ap-south-1a

No alt text provided for this image

At last we have to attach the above created EBS volume to the instance

for attaching we use the command :

aws ec2 attach-volume --instance-id i-0c151594d14a255d3 --volume-id vol-03bf06391710e8fc7 --device /dev/sdh

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

So, in this task i done the above mentioned task and shows its details

Thanks to Vimal Daga sir

visit my github link for more projects :ayushgithub

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

Ayush Milan的更多文章

社区洞察

其他会员也浏览了