All about EC2
Topics
- Definition
- Detailed Explanation
- Create and use Ec2 Instance.
let's see some technical definitions of it —
Amazon EC2, or Elastic Compute Cloud, offers a flexible and scalable way to host applications and process data in the cloud. Let’s break down its name:
- Elastic: You can easily adjust the number and size of servers (instances) to match your needs. Scale up for increased demand or down when it decreases.
- Compute: EC2 provides virtual machines (instances) with computing resources like CPU and memory to host applications and handle data processing tasks.
- Cloud: EC2 operates in the cloud, hosting instances on AWS servers distributed across various data centers.
Amazon EC2 allows you to launch virtual machines with various operating systems, such as Windows or Linux, and control inbound and outbound traffic using security groups. EC2 is a fundamental AWS service for hosting applications and managing compute resources.
if you get it… congrats…🤴🏻 you have understanding of basic concepts … can start implementation
other wise i will be breaking it down bellow.
EC2 Mistory
what
- It is a tool/environment to create a Virtual machine on the AWS platform
- we can create multiple virtual machines and each of these is referred to as an instance(1 unit of VMs). (what is VM/hypervisor => (article1) (article 2) )
A virtual machine can often be the easiest compute option in AWS to understand. This is because a virtual machine emulates a physical server and allows you to install an HTTP server to run your applications
To run these virtual machines, you install a hypervisor on a host machine. This hypervisor provisions the resources to create and run your virtual machines.
In AWS, these virtual machines are called Amazon Elastic Compute Cloud or Amazon EC2. Behind the scenes, AWS operates and manages the host machines and the hypervisor layer. AWS also installs the virtual machine operating system, called the guest operating system
Where
EC2 is a popular choice for a variety of workloads, including:
- Web servers
- Database servers
- Application servers
- Development and testing environments
- High-performance computing (HPC)
- Machine learning
Why
- EC2 eliminates the need for on-premises infrastructure and provides cost-effective, resizable computing resources for a wide range of applications and services.
- EC2 delivers secure and scalable computing capacity in the cloud. EC2 instances are versatile and suitable for various workloads
- EC2 is a pay-as-you-go service, so you only pay for the resources that you use.
Types of EC2 Instances
- General Purpose
- Compute Optimized (ml models, gaming servers, etc)
- Memory Optimized (heavy task, )
- Storage Optimized
- Accelerated
EC2 Instance Lifecycle
An EC2 instance transitions between different states from the moment you create it all the way through to its termination
Where Does Your EC2 Instance Live?
By default, your EC2 instances are placed in a network called the default Amazon Virtual Private Cloud (VPC). This network was created so that you can easily get started with Amazon EC2 without having to learn how to create and configure a VPC. any resource you put inside the default VPC will be public and accessible via the Internet.
(I will discuss more on networks in future articles)
Let's Create An EC2 Instance
[Note]: while creating an instance consider the availability of “Free Tier” for any choice… for example: AMI, instance type, etc…
- navigate: EC2 > Instance > Launch Instance
- provide instance name
- select OS
- Select Instance Type
- select an existing Key pair or create a new one.
- key pairs: these key pairs are used to login to the instance
- keep it safe
- click on create
you can log in with CLI with the key pairs
- ex: MobeXterm, putty,
- in instance configuration there is two IP available ‘Public IP’ and ‘Private IP’ (make sure the instance is in running state).
- ‘public key’ is used to connect from a remote device. Ex. using SSH.
To access it from Windows:
Tools: PuTTY, Mobaxterm, CLI, git
- Steps to run it in CLI
- Open the terminal in the same file where you have stored <key.pem> file.
- ssh -i <”pem file name with extension”> ec2-user@ec2-< public-ip >.< region >.compute.amazonaws.com (This command can be found on the ‘connect to instance’ page in AWS)
— End —
Contact me for any dilemmatic questions.
#happylearning #learninpublic #cloud