Task : AWS CSA And DEVELOPER Track

Task : AWS CSA And DEVELOPER Track

AWS Task 1 : Perform Below Operation with AWS CLI

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

Solution:

a. Creating Key-Pair

Command : aws ec2 create-key-pair --key-name Test

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

b. TO describe Key pair

Command : aws ec2 describe-key-pairs

No alt text provided for this image

c. TO create an security group for ec2

Command : aws ec2 create-security-group --group-name MySG --description "My SG"

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


d. To Describe Security Group

Command : aws ec2 describe-security-groups --group-ids sg-0a27ad7342966d9dd

No alt text provided for this image

e. TO launch an instance 

Command : aws ec2 run-instances --image-id ami-0947d2ba12ee1ff75 --instance-type t2.micro --count 1 --subnet-id subnet-61afd02c --security-group-ids sg-0a27ad7342966d9dd --key-name Test

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


f. TO create volume 

Command : aws ec2 create-volume --availability-zone us-east-1a --volume-type gp2 --size 1

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

g. To attach a volume

Command : aws ec2 attach-volume --device /dev/sdf --instance-id i-0ee4854d7afd36f7e --volume-id vol-08d216c1309e22ae8

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

Done!!!!!!!!!!



To view or add a comment, sign in

More articles by Dikshant Mali

Explore content categories