
Amazon EC2 Understanding In AWS Cloud Computing
Discover Amazon EC2 (Elastic Compute Cloud), one of the fundamental services of AWS. Learn how to launch virtual servers, understand instance types, security groups, storage, pricing models, and explore how EC2 helps you host and scale applications in the cloud.
AWS Certified Cloud Practitioner | Aspiring Cloud Support Engineer
What is Amazon EC2?
Amazon EC2 is a cloud-based service, offered by Amazon Web Services (AWS), for provisioning and managing cloud-based virtual servers.
These cloud-based virtual servers are known as EC2 Instances.
Rather than having to buy and maintain physical servers, you can now quickly provision a cloud-based virtual server (an EC2 instance) to develop, host, and/or manage your applications and/or data.
Furthermore, you can even add or remove server resources according to your application’s needs.
Why Do We Need Amazon EC2?
To further demonstrate, consider that you are developing an online retail platform. At first, perhaps just 100 people will visit your site daily. However, with the popularity of a particular sale within a festival period for example, your daily user numbers may rapidly rise to 10,000.
If you were to use physical servers, there may be a time and cost implication in upgrading these.
Nevertheless, with Amazon EC2 you can easily provision the appropriate server resources and then scale accordingly.
Benefits of Amazon EC2 include:
Scalability – Resources can be added or removed.
Flexibility – Various instance types can be selected according to CPU, memory, storage and networking requirements.
Cost effective – You can pay for the server resources that you utilize (depending on your chosen payment method).
High Availability – The ability to place instances within various Availability Zones.
Security – Access can be managed and controlled through AWS IAM, security groups and network settings.
Key Amazon EC2 Concepts
There are several important elements to consider prior to provisioning your first EC2 instance.
- Amazon Machine Image (AMI)
An AMI is a template for setting up an EC2 instance.
It includes the details needed to set up your instance. For example, this might involve details relating to the operating system and application(s).
Examples of operating systems available include:
Amazon Linux
Ubuntu
Red Hat Enterprise Linux
Microsoft Windows Server
- Instance Type
This refers to the server resources available to an instance.
Different applications will often require different levels of server resources.
Examples of instance types include:
General Purpose – for hosting servers and/or for application development.
Compute Optimized – for CPU heavy applications.
Memory Optimized – for applications requiring large memory resources.
Storage Optimized – for accessing fast storage.
- Key Pair
This is used to securely log onto an EC2 instance.
For Linux, SSH keys are generally used for this. Generally, for Windows, a key pair is used to obtain an administrator password.
- Security Group
Security Groups function as a virtual firewall for your EC2 instance.
They regulate what data can come in to, and also leave, your server.
Examples of ‘ports’ and their associated functions include:
Port 22 – for SSH connections.
Port 80 – for HTTP data.
Port 443 – for HTTPS data.
Only permit data types which your application truly needs.
- Amazon EBS
Amazon Elastic Block Store is a form of persistent storage for EC2 instances.
It can essentially be viewed as a virtual hard drive – and can then be connected to an EC2 instance.
Operating systems and applications, along with other information, can then be stored within this.
How Does Amazon EC2 Work?
Below is an outline of how to provision an EC2 instance.
- Access the AWS Management Console.
- Go to the EC2 service.
- Click on "Launch Instance".
- Enter a name for your instance.
- Choose an AMI (for example, Amazon Linux).
- Decide on an instance type.
- Set-up or generate a key-pair.
- Define network and security group settings.
- Define storage for your instance.
- Confirm your settings and then provision your instance.
Following this, you will be able to log onto your new instance and then begin to deploy your applications.
Using EC2 To Host A Website
Assume that you wish to host a basic website on AWS.
You can utilize Amazon EC2 to provision a virtual Linux-based server.
Following instance provisioning, you can then:
- Log onto your EC2 instance (using SSH).
- Install an application for hosting websites, for example, Apache.
- Upload your website.
- Update your security group settings so that port 80 (for HTTP data) is permitted.
- View your website by entering either your instance’s public IP address or defined domain name into a browser.
In this way, your website can then be accessed via the internet.
This is a very common introductory use for Amazon EC2.
Amazon EC2 Pricing
Depending on your application, AWS offers a variety of pricing structures for Amazon EC2.
On-Demand Instances
Resources can be paid for with no long-term obligation. This is ideal for fluctuating application needs.
Reserved Instances
By agreeing to utilize a given instance type for a period of either one or three years, you can benefit from a reduced rate in comparison to On-Demand pricing.
Spot Instances
These utilize under-utilized AWS server resources and can therefore be provisioned at a reduced cost. However, AWS has the right to terminate these instances. As such, they are well suited to applications that can tolerate this.
Savings Plans
By pledging to utilize a given hourly volume of server resources for either one or three years, you can obtain a reduced rate on qualifying server resources.
Always ensure that you review AWS’ current pricing for the relevant region and instance-typ
Comparison Of Traditional Servers And Amazon EC2
Traditional Servers | Amazon EC2 |
|---|---|
Requires physical hardware | Uses virtual servers |
Hardware setup takes time | Instances can launch in minutes |
Hardware maintenance is required | AWS manages the underlying infrastructure |
Scaling may require hardware upgrades | Computing capacity can be adjusted |
Usually requires upfront hardware investment | Offers multiple pay-as-you-go pricing options |
Conclusion
Alongside being one of AWS’ core services, Amazon EC2 plays an integral role in cloud computing.
Whether you are new to cloud computing, a developer or part of an organization seeking to transfer its infrastructure to AWS, it is important that you comprehend Amazon EC2.
Whilst becoming familiar with Amazon EC2 is key, I would recommend that those new to AWS also endvour to provision an EC2 instance, log-on to it, install a web server application and in turn host a basic website.
As previously highlighted, it is through hands-on experience that theoretical cloud computing knowledge can effectively be translated into practical skills.
Happy Learning and Building!
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article