- 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.
Key name: Task2Key
aws ec2 create-key-pair --key-name Task2Key
security group name: aws-task2-allowall
aws ec2 create-security-group --group-name aws-task2-allowall --description "Allow all traffic"
aws ec2 authorize-security-group-ingress --group-name aws-task2-allowall --protocol all --cidr 0.0.0.0/0
aws ec2 run-instances --image-id ami-00bf4ae5a7909786c --instance-type t2.micro --count 1 --key-name Task2Key --security-group-ids sg-02f0d54f37070f560
aws ec2 create-volume --volume-type gp2 --size 1 --availability-zone ap-south-1b
aws ec2 attach-volume --instance-id i-0af875947f5e766f5 --volume-id vol-0389acab0065c118c --device /dev/xvdh
Link for other tasks