HOW TO ACCESS 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.
All the above steps must be performed using AWS CLI
INTRODUCTION
🤔What is AWS CLI?
AWS CLI is a tool that pulls all the AWS services together in one central console, giving you easy control of multiple AWS services with a single tool. The acronym stands for Amazon Web Services Command Line Interface because, as its name suggests, users operate it from the command line. With it, you can control services manually or automate them with powerful scripts.
📝How It Works ?
AWS is a secure cloud services platform that offers computing power, content delivery, database storage, and other infrastructure services for developers. Proponents point to its speed, flexible pricing, exemplary customer service, and a huge variety of services as benefits. The AWS CLI puts the icing on the cake by tying control of all those services together into one simple command line interface. It cuts out the user-friendly (but time-consuming, according to some) step of interacting with the system through a Graphical User Interface (GUI).
How to Install AWS CLI
You can install the tool by downloading it from the AWS CLI resource page at Amazon. The page has download options for Windows, Mac, and Linux installations. It also has a beginner’s guide, a comprehensive reference manual, a user forum and a link to the GitHub project. Here are the install tools offered by Amazon:
- Windows 64-bit download
- Windows 32-bit download
- Chocolately: choco awscli
- Mac and Linux download (requires Python 2.6.5 or greater)
- Pip install link
- Getting started guide
- CLI Reference from Amazon
- GitHub project
- User forum
1) Configure AWS
Let’s we start task practical
Now first give AWS credentials, for this we need Access key & Secret key for configure AWS and these will get while creating an IAM User in AWS.
2)Create a key pair
Creating private key to connect with the ec2 instance .
for creating new pair key use below command :-
aws ec2 create-key-pair — key-name <key_name>
3)Create a security group
- To create a security group use below command :-
aws ec2 create-security-group — description <“description”> — group-name <“group_name”>
3)Launch an instance using the above created key pair and security group
Launch a new EC2 Instance using above created key pair & security group.
Launch EC2 Instance using below command :-
aws ec2 run-instances — image-id ami-0e306788ff2473ccb — instance-type t2.micro — count 1 — subnet-id subnet-35b4df79 — security-group-id sg-032703f3eb123837d — key-name firstkey
4)Create an EBS volume of 1 GB
Now we create New EBS VOLUME OF 1 GB
BY USING BELOW COMMAND
aws ec2 create-volume — availability-zone “ap-south-1” — size 1
5)The final step is to attach the above created EBS volume to the instance you created in the previous steps
Now attach the EBS VOLUME to the INSTANCE by using below command :-
aws ec2 attach-volume — device “xvdb” — volume-id “vol-063d19ea577bb4c3e” — instance-id “i-0ca573d49cad9859a”
Getting full information about EC2 Instances use below command :-
aws ec2 describe-instances
“IF U ENJOYED READING THIS ARTICLE CLAPS IT SHARE IT AND FOLLOW ME IN LINKEDIN OR MEDIUM AND DON’T FORGET TO GIVE YOUR FEEDBACK’’
“KEEP LEARNING & KEEP SHARING”
“THANKS TO READ THIS ARTICLE”