AWS CLI Management
Ayush Milan
Data Scientist | GenAI | Certified Cloud Practitioner | AWS | Azure | Databricks | Technical Content Writer
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
Using aws we have to first configure it using the access key and secret key
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
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"
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
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
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
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