Point to be discussed in this blog:-
- What is AWS?
- What is AWS CLI?
- How to Create Key pair in AWS using CLI?
- How to Delete Key pair in AWS using CLI?
- How to create and delete Security group?
- How to Start, Stop, and Terminate instance?
- How to Launch a new instance?
- How to create EBS Volume of 1 GB?
- How to attach EBS Volume to an instance?
So let's get started:-
Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 175 fully-featured services from data centers globally. Millions of customers including the fastest-growing startups, largest enterprises, and leading government agencies are using AWS to lower costs, become more agile, and innovate faster.
The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
The AWS Command Line Interface (AWS CLI) is an open source tool that enables you to interact with AWS services using commands in your command-line shell. With minimal configuration, the AWS CLI enables you to start running commands that implement functionality equivalent to that provided by the browser-based AWS Management Console from the command prompt in your terminal program
To run AWS CLI in windows we need to download software of AWS CLI.
Before getting started with aws cli , first we need to do following task:
Click on Add user.
Add user name and select Access type.
Attach existing policies.
After this configuration Access key and Secret key will be provided, which will be used to login in AWS CLI.
To login in AWS CLI use command: aws configure.
And then add Access and Secret key which is provided when we create IAM user.
Now we are successfully logged in to aws cli.
- How to Create Key pair in AWS using CLI?
To create Key pair use the following command:
aws ec2 create-key-pair --key-name Nitesh-key
After running this command key will be created...
output:
- How to Delete Key pair in AWS using CLI?
To Delete Key pair use the following command:
aws ec2 delete-key-pair --key-name Nitesh-key
After running this command Key will be deleted successfully.
- How to create and delete the Security group?
To create a Security group use the following command:
aws ec2 create-security-group --group-name Nitesh --description nitesh1
After running this command Security group will be created successfully:
output:
To delete the Security group use the following command:
aws ec2 delete-security-group --group-name Nitesh
- How to Start, Stop, and Terminate instance?
To start instance use the following command:
aws ec2 start-instances --instance-ids i-068deae51c97
output:
To stop instance use the following command:
aws ec2 stop-instances --instance-ids i-068deae51c977
Output:
To Terminate instance use the following command:
aws ec2 terminate-instances --instance-ids i-068deae51c977
Output:
- How to Launch a new instance?
To Launch new instance use the following command:
aws ec2 run-instances --image-id ami-052c08d70def0ac62 --instance-type t2.micro --count 1 --subnet-id subnet-31595659 --security-group-ids sg-026ea953028eef330 --key-name ARTH
Output:
- How to create EBS Volume of size 1 GB?
To create EBS volume use the following commands:
aws ec2 create-volume --availability-zone ap-south-1a --size 1
Output:
- How to attach EBS Volume to an instance?
To attach EBS volume to an instance use the following command:
aws ec2 attach-volume --volume-id vol-0b46d2453ff0a064a --instance-id i-061ec2033deb1e8d1 --device /dev/sdf
Output:
Video Demonstration of the task:
Comments
Post a Comment
If you have any doubt please comment.