Amazon Web Services is one of the leading Cloud Service Providers in the market. It is known for its 200+ services it offers. One of those services is AWS EC2, which is easily one of the most popular Cloud service in the market. This article will help you understand and explore AWS EC2 in detail.
Following pointers will be covered in this article,
- What is AWS?
- AWS Compute Services
- What is AWS EC2?
- Types of AWS EC2 Instances
- Launching a Virtual Machine with AWS EC2
So let us get started with the article.
What is AWS?
AWS or Amazon Web Services, as mentioned above is one of the most popular Cloud Service providers in the market. It is a full-fledged Public Cloud Service Provider that offers 200+ cloud services and serves in 240+ countries. AWS has the highest market share in terms of Public Cloud market.
It is an on-demand Public Cloud Service Provider which offers cloud services that can accessed from anywhere across the globe. With Amazon Web Services you do not need to maintain or monitor these services. The vendor takes care of all the management and maintenance part. Another benefit of using AWS is it offers metered usage, that means you will be charged only for the resources used and only for the duration you have used those resources.
It offers following features:
- Metered Usage
- Management Support
- Availability, etc
This was about what is AWS? Let us go ahead and AWS Compute Services,
AWS Computer Services
Computation services are services that offer computation power or computation capacity to run your system. This is like providing you server capacity to run your applications.
AWS offers plenty of services that offer computation capacity in different levels with different configuration to meet you individual and business needs. Let us take a look at some of those services one by one,
Amazon Lambda is Serverless compute service offered by AWS. With AWS Lambda you have ability to run your code without having to worry about provisioning or managing servers. Here you can run code with any type of application virtually with any type of backend or service. That means you need zero administration.
Amazon Elastic Beanstalk
Amazon Elastic Beanstalk is a PaaS or Platform as a Service offered by AWS. Here the vendor or Amazon Web Services offers a platform for you to use, all you do is bring your data/code and your application, put it on top of Amazon Elastic Beanstalk and run the application on top of AWS.
AWS Autoscaling and Load Balancers
With AWS Autoscaling you scale your instances automatically to scale to the changing need of application being hosted. AWS Load Balancers on the other hand ensure that if any of your cloud servers are experiencing access traffic that get redirected to some other server or machine.
This was about different compute services offered by AWS, however we will now go ahead and discuss the last compute service which is the topic of this article. So let us get started,
What is AWS EC2?
AWS EC2 is a compute service that provides IaaS services on AWS Cloud Platform. IaaS stands for Infrastructure as a Service. That means complete infrastructure is provided by AWS which you can configure to suit your needs.
With EC2 you can launch instances of different types. Let us understand what instances are. You may think of Instances which are nothing but mini computers that have their separate small storage, network and compute capacity.
These mini computers can be called as Instances. In more sophisticated term, these are nothing but virtual machines that reside on server but give you a feel of running on your system.
Amazon EC2 offers instances that can be a Windows Operating System, can be an Unbuntu or Linux Operating system and many more. With these instances it is possible to take backup of data, create replicas or templates of instances being used.
AWS EC2 has a large family of EC2 instances and they vary based on quite a few factors. Let us try and understand these instances one by one,
Types of AWS EC2 Instances
As mentioned already AWS offers many kinds of instances, let us try and understand what are the types of AWS EC2 Compute Instances first. Following is the list of the same,
- General Purpose Instances
- Compute Optimized
- Memory Optimized
- Storage Optimized
- Accelerated Computing
Let us start by understanding them in the above order,
General Purpose Instances
These instances provide balance in computation, memory, and network capabilities. They can handle variety of workloads and serve diverse set of purposes. If your applications need resources in equal proportions be it your servers, repositories etc, then you can opt for AWS EC2 general purpose instances
Following are some of its features,
- They have custom built processors
- Provide networking services with high network bandwidth
- EBS optimized volume
Compute Optimized Instances
If you have applications that need processors with high performance, then you should opt for AWS EC2 Compute optimized instances. In short they are best suited for Compute bound applications. These instances are also well suited to support Batch Processing kind of workloads and media transcoding, high performance servers. Other notable applications would be gaming servers, ad servers, machine learning applications or any other requirement that is compute intensive in nature. Compute optimized instances will have you covered here. Let us go ahead and take a look at some of the features of AWS Optimized Compute Instances:
- They support custom built processors known as AWS Gravitation 2 processors
- These are EBS optimized just like general purpose instances
- Enhanced networking is supported up to 25 GBPS of bandwidth
It is powered by AWS Nitro System, a combination of dedicated hardware and lightweight hypervisor.
Let us now go ahead and understand memory instances by AWS.
Memory Optimised Instances
These are designed for fast optimized performance. The aim is the ability to process workloads with large data set processing in memory. Following types of instances fall under memory optimized instances:
The EC2 R6g instances are powered by processors AWS Gravition2. These are the latest ones and give 40% performance in terms of pricing. These are good for memory intensive applications. They offer following features:
- They support 64-bit Arm Neoverse cores
- Networking support is again up to 25gb bandwidth
- By default, EBS backup
- And are powered by Nitro systems
Let us now go ahead and understand other types of instances.
Storage Optimized Instances
These type of instances are designed to manage workloads where you need constant and high speed read write access. Also the data sets being dealt are voluminous and reside on local storage. The number of IO operations that can be delivered using these instances are in 10s of thousands per second.
It supports following set of families,
It provides following features,
- It uses High Frequency Intel Xeon E5-2686 v4 Processors and have base frequency of 2.3 GHz
- It offers network bandwidth Up to 25 GB of network bandwidth and uses Elastic Network Adapter (ENA)-based Enhanced Networking
- It offers high I/O performance and even Sequential Read throughput
- You get support for bare metal instance size for workloads that require direct access to physical processor and memory
These instances can be thought of as Graphical processing intensive type of instances. They may use hardware accelerators or even co processors to perform intensive calculations or do graphical processing., eve pattern matching. This happens at a better efficiency than the normal software that runs of systems.
It supports following types or family instance sets,
This was about different EC2 instances based on their family types. Now let us go ahead and understand these instances based on their pricing models. We have following classifications in our hand,
- On Demand
- Spot Instances
- Dedicated Instances
Let us understand these one by one,
As the name suggests, these instances can be requested on demand. These instances do not require any upfront costs. When you request an instance, it is made available to you and it serves a particular purpose for you. These instances scale up depending upon the need of the application and you will be charged accordingly.
These instances are best suited for following types of applications,
- Applications needing low latency services and no upfront costs for undisturbed performance
- In cases where you need un interrupted performance, and need to handle spiky short term inconsistent traffic
- These are more suited for applications that being developed or tested for the first time
So this is how on demand instances operate, let us now go ahead and understand Spot instances,
If you have workloads that can be managed by instances, which do not require specific configurations then AWS EC2 Spot instances will serve you well. With AWS you can request for instances that are spare with AWS EC2. You can expect these instances to have 90% off the On-Demand price
It is useful for applications that are
- Big data,
- Containerized workloads,
- Web servers
- High-performance computing (HPC)
- Test & development workloads
These instances are can be recommended for:
- Applications with flexible start and end times
- Applications feasible at very low compute prices
- Applications with urgent computing needs for large amounts of additional capacity
So this was about Spot instances, let us now go ahead and understand what are Reserved Instances,
When you are certain about the capacity and time in which you want to use EC2 resource it is wise to opt for AWS EC2 reserved instances, these ensure, you get a good discount here. Since you are aware about the requirement, it is booking or reserving those instances for a particular duration. The discounts here can be as significant as 75% if you compare it with on demand instances which understandable.
These are best suited for applications that require steady state or have predictable state.
Following applications are best served here:
- Applications with Steady State
- Applications needing reserved capacity
- Applications that can be committed for 1 to 3 years of usage
So this was about reserved instances, lets us now go ahead and understand what are dedicated instances,
These instances are best suited for applications that need to or can be used with Server Bound Applications. Here you have a host that uses Dedicated EC2 Server and since we are using Server bound resources it is also available cheaply. It supports following licenses:
SUSE Linux Enterprise Server etc
These servers are also good when it comes to security concerns. Since these are dedicated servers, you have more security overall and security intensive applications feel safer here
These instances give you options in terms of purchasing as well,
- You can purchase them On-Demand (hourly basis)
- You may reserve these instances and save up to 70% on these instances
So this was about Reserved Instances. And this was about different types of instances that AWS EC2 offer. There are more options it offers, but these are the major ones under the hood. Let us now go ahead and see how you can use AWS EC2 instances practically.
To do this you would be needing access to AWS Freer Tier Account. If you don’t have one, ensure you visit AWS official web site and sign up to AWS Free tier account which you can use free of cost for one complete year. Assuming that you have a free tier account, let us go ahead and take a look at the practical implementation.
Launching a Virtual Machine with AWS EC2
Once you sign up for a fee tier AWS console, you will see the following page,
Click on Services and you will see all the services AWS provides. Under Compute Domain, click on AWS EC2,
Click on running instances,
Click on launch instances,
You will be taken to AWS EC2 AMI page, where you have option to choose different instances, we will select a free tier eligible Windows Server instance by scrolling down the list
Note: AWS EC2 AMI or Amazon Machine Image is nothing but a template of instance or virtual machine which preconfigured to suit certain configuration requirements
With AWS you have the option to configure the settings to suit your needs, however we will stick to the default requirements here, so continue clicking next until we reach the below page. Here we will create a key value pair that helps login to the instance. This key pair if lost you cannot login to an AWS Instance, so ensure you download it and keep it safe. Then click on ‘Launch Instance’
Click on view instance and you will be directed to following page, wait till the status checks for the instance are complete and green. Click on Connect on the top left corner
Following page will appear,
Download RDP, this is what we will use to log in to AWS EC2 instance, click on get password,
Once you click on get password, you get a prompt to select the key you want to decrypt. Select the PEM key-pair file, we downloaded during launching the instance. Now decrypt it and open the RDP file that was downloaded in previous step, also keep the password decrypted copied.
Click on connect, following window will appear, enter the decrypted key in the password, say OK and say yes,
There you go, your AWS EC2 instance is up and running. This instance will look like and function as Windows virtual machine.
You can configure this instance you suit your needs further. But that discussion is for some other article. Also you note you can launch other types of EC2 instances like Ubuntu, linux, etc. Do give it a try.
This brings us to the end of this article, we hope you liked AWS EC2 tutorial article. In case of queries, put those in the comment section and our team would revert at the earliest. Happy Learning.0