Launching EC2 Instance using CLI and attaching an EBS volume
What is the Amazon web service?
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. More than 90%of the world’s biggest public game companies, including Activision, Supercell, and Ubisoft, are using AWS.
What are the Command-line interface (CLI) and AWS (CLI)?
A command-line interface process commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-line processor. Similarly, 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.
Why do we use AWS CLI?
AWS CLI gives you the ability to automate the entire process of controlling and managing AWS services through scripts. These scripts make it easy for users to fully automate cloud infrastructure. Prior to AWS CLI, users needed a dedicated CLI tool for just the EC2 service.
In this task
Prerequisites for this task
Let's configure the CLI of AWS
C:\> aws --version
aws-cli/2.0.47 Python/3.7.4 Windows/10 botocore/2.0.0
#To create an access key for an IAM user
1. Sign in to the AWS Management Console and open the IAM console
2. Search for users and create one
#We need to give permissions to a user to successfully authenticate with CLI.
#After this step create a user and the Access Key and Secret key will be displayed
#We have successfully created a user
#To configure AWS we need the following things:
#To connect with the Ec2 instance we need a private key, If you already have the key no need to create
#We can create a new security group.
#After getting all things ready Let's launch an ec-2 instance.
#We can cross-check it by using the GUI or CLI.
#In this image, the instance is starting, and After the instance is started we are gonna create an EBS volume of 1 GB.
#The command for Creating EBS volume is
NOTE: To successfully attach a volume to an instance both instances and volume should be in the same region.
Let's view in GUI if the volume is created or not
#Now we have to connect the EBS volume of 1 GB to the EC-2 instance we created.
successfully we done!!
Thanks for reading 🙋♂️