Task 1 AWS CLI(Command Line Interface)
Harsh Rajotya
Technical Blogger & DevOps Engineer @ Medium & DevOpsFarm Inc | Writing, Automation, Cloud
Hello Everyone !!!
Today’s my Article is on AWS CLI
In this task we have to
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 size 1 GB.
And the final step is to attach above created EBS volume to the Instance created in previous steps.
what is AWS CLI ??
- The AWS Command Line Interface (CLI) is a unified tool to manage our AWS services.
- We can control multiple AWS services from the command line.
First, we need to download the AWS CLI.
You can download from the below site. https://awscli.amazonaws.com/AWSCLIV2.msi
First check cli installed or not
for this use command..
<aws --version>
AWS Configure
After installing the AWS CLI, we now need to configure the application to be able to connect to our AWS account.
For this Command is..
<aws configure>
After this we have to login by AWS access key ID and AWS secret access key.
Now, we have to Create a Key Pair
we have to search for available command
Now, use the below command
aws ec2 create-key-pair --key-name firstSkey
Create a Security group
we have to search for available command
Now, use below command for this
aws ec2 create-security-group --group-name firstSG --description “FirstSG”
Launch ec2 instance using the above created Key pair and Security
Now, search for available command to run the instance..
Now, we launch the ec2 Instance by using the command…
aws ec2 run-instance --image-id ami-0e306788ff2473ccb --instance-type t2.micro --count 1 --subnet-id subnet-37666f5f --security-group-ids sg-067ccba5d22175a53 --key-name firstSkey
Status of Running instance in WebUI
Create an EBS Volume of size 1 GB
Now, search for available command
Now,use the below command to create volume of size 1 GB
aws ec2 create-volume --volume-type gp2 -- size 1 --availability-zone ap-south-1a
NOTE: The EBS Volume should be created in the same availability zone as of EC2 instance to be it should be attached
Attaching above created EBS volume to the ec2 Instance
Now, search for available command
Attaching above created EBS volume to the ec2 Instance
Now, search for available command
Now, use the command to attach above volume to ec2 instance
aws ec2 attach-volume --volume-id vol-1234567890abcdef0 --instance-id i-01474ef662b89480 --device /dev/sdg
Status of Volume attach in WebUI
Thanks for reading!! ???
Be safe take care ?
DevOps Engineer | Cloud Engineer| Docker | Jenkins | Kubernetes | Terraform | Squadcasts
4 年Great work Harsh Rajotya
DevOps Cloud Engineer | PGDM in Big Data Analytics | AWS | CI/CD | Kubernetes | Automation | IT Enthusiast | Problem Solver | Startup Mindset
4 年Good Job Harsh Rajotya bro ???