Using CLI(Command Line Interface) to ...

Using CLI(Command Line Interface) to ...

🔅 Create a key pair

create-key-pair --key-name MyAWSKey

No alt text provided for this image


🔅 Create a security group

aws ec2 create-security-group --group-name Myfirewall --description "My firewall security group"

No alt text provided for this image


🔅 Launch an instance using the above created key pair and security group.

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

No alt text provided for this image


🔅 Create an EBS volume of 1 GB.

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

No alt text provided for this image


🔅 The final step is to attach the above created EBS volume to the instance you created in the previous

aws ec2 attach-volume --volume-id vol-025642fda942cbf90 --instance-id i-0a3be4e04f181de0a --device /dev/sdf

No alt text provided for this image



To view or add a comment, sign in

More articles by Nitin Tilwani

Explore content categories