We had understood the virtual machines, what they are, and how they work. Let us dive into understanding the creation of the Virtual Machines and connecting them to AWS. Before that, let us have a basic recap of the virtual machines
Recap
Virtual machines (VMs) are like digital computers running inside a physical computer. They allow multiple operating systems to coexist on one machine, making it more efficient and flexible. VMs are commonly used in cloud computing and data centers to save resources and enhance scalability.
In the AWS (Amazon web services) context, we call the instances of the virtual machine EC2 instances.
The general way to create an EC2 instance
The fundamental way of creating an EC2 instance is by visiting the AWS Console, a UI provided by AWS to access their services.
One should visit the UI to request the AWS EC2 instance and eventually get the IP address for the instance, which we will learn in the next sections.
Importance of Automation
We have manually created the instances in the previous section, but what if you have plenty of requests for the ec2 instances? The manual way of working in DevOps is considered a red flag as it can produce errors, decrease efficiency, and consume a lot of time.
Automation of tasks is the solution to the manual way of working. AWS provides APIs for the tasks needed to be done in an automated fashion. For example, we have AWS EC2 API for the EC2 instance creation. AWS S3 API for the S3 bucket creation, etc.
The user would write a script that would call the API to create the instances, eventually sending the instances in response.
Script
The script is nothing but the code we write to call the API or hit the API endpoints that work for the creation of the EC2 instance or any other infrastructure we want to create.
there are different ways of writing scripts
AWS Command Line Interface
Directly interacting with the API endpoints, using BOTO3 module in Python
AWS Cloud Formation Template
Terraform, which can used for multiple cloud platforms for automation. It is generally used for companies that use a hybrid model for cloud usage. For example, Google, it uses different cloud platforms for its different fields, in such cases terraform would be a great choice for the automation purposes
AWS CDK, which is a proprietary tool of AWS, has more edge than Terraform
A request is responded with the creation of an EC2 instance when it satisfies the following criteria
Valid - A request has to be valid.
Authenticated - The user should have access to AWS.
Authorized - Even though the user is authenticated, the user should be authorized to use the services.
AWS Services
To use the AWS services, you need first to have an AWS account.
The following steps will guide you to create an EC2 instance
-
You have the instances created in the dashboard; we'll learn the instance connection and handling in the next blogs
Please find the codes and assignments for the boot camp in the GitHub Repository. There are no codes for this session, but you can visit other codes out there in the repo
Stay tuned for the upcoming blogs and exciting algorithms.