I remember back in the days that having an access to a physical server is difficult and costly for use cases that you just need to develop, deploy or simply evaluate an application.Not only you need to think of the different moving parts of a server for both Software and Hardware but you also need time for your application. But now in the advent of cloud computing there are several cloud providers that can give you this kind of service mainly called IaaS or Infrastructure As A Service. In this article I will discuss to you one of the core services offered by AWS which is EC2 or Elastic Compute Cloud.
What is Elastic Compute Cloud?
In the simplest view of Elastic Compute Cloud think of it as a Machine with an Operating System and compose of different Hardware components depending on your choice but the only thing is that it is in the form of Virtualized setup. EC2 enables on-demand and scalable computing capacity in the AWS cloud that eliminates the up-front investment for hardware, and there is no need to maintain any rented hardware. In this way you will have time to focus more on building and deploying applications and have the capability to launch and run as many virtual servers as you need. Lastly the word “Elastic” from the name itself Elastic Compute Cloud shows the system’s capability of adapting to varying workloads and provisioning or removing resources according to the demand.
What are the Features of Elastic Compute Cloud?
Now that we have an overview of what really is AWS Elastic Compute Cloud lets try to discuss and understand why we really need it as well as the benefits of using AWS Elastic Compute Cloud. Below are the main features and benefits of EC2:
Global Infrastructure
- AWS Elastic Compute Cloud Instances can be placed on different multiple locations leveraging the global infrastructure of AWS which are composed of Regions and Availability Zones.
- Availability Zones are distinct locations that were designed to be fault tolerance from failures from other Availability Zones which also provides inexpensive, low latency network connectivity to other Availability Zones in the same Region.
- Regions consist of one or more Availability Zones and are geographically dispersed.
- The Amazon EC2 Service Level Agreement commitment is 99.99% availability for each EC2 Region.
Cost and Capacity Optimization
- This is one of the main selling point of EC2 which pay for what you only use. It will take the cost of unused minutes and seconds in an hour off of the bill so you can focus on improving your applications.
- It supports Auto Scaling which allows you to automatically scale your EC2 capacity UP or DOWN depending on you set conditions. This will reduce or eliminate the plan for unknown forecasts.
- Can be integrated with Amazon EC2 Fleet which lets you provision compute capacity across EC2 instance types, Availability Zones, and purchase models in optimizing scale, performance and costs.
- Optimization of CPU usage through custom configurations based on the number of vCPUs when launching new instances. Enable/Disable Intel Hyper-threading Technology for workloads that perform well with single-threaded CPU.
- You can hibernate your EC2 instances backed by Amazon EBS and resume them from this state at a later time.
Storage
- Amazon EC2 can integrate with different storage services by AWS depending on the Workload type. Beyond the built-in instance storage, it also offers Amazon Elastic Block Store and Amazon Elastic File System.
- Amazon EBS provides persistent, highly available, consistent, low-latency block storage volumes for use with Amzaon EC2 while Amazon EFS provides simple, scalable, persistent, fully managed cloud file storage.
Networking
- EC2 has a network feature called Enhanced Networking that enables you to get significantly higher packet per second performance, lower network jitter and lower latencies.
- Can integrate with elastic Fabric Adapter which is a network interface for Amazon EC2 instances that enables you to run applications requiring high levels of inter-instance communications like machine learning, computation fluid dynamics etc.
- Elastic IP addresses are static IP addresses designed for dynamic cloud computing.
- EC2 has high throughput and low latency with High Performance Computing clusters.
- EC2 can easily access services hosted on AWS easily and securely through AWS private link.
Operating Systems
- With the use of Amazon Machine Images which are pre-configured with an ever-growing list of operating systems which includes Windows, Linux and MAC. You can also visit the AWS Marketplace for a wide selection of commercial and free software from well-known vendors which are designed to run on you EC2 Instances.
Demo: Creating AWS Elastic Compute Cloud
Now that we know what is EC2 and the features available for us to use, I will now show to you how easy and quick to create your own EC2 as well as how to access it. For this demo purposes will leverage the free tier only so that we will not incur any charges. Login to your root account and on the main page kindly search for the “Elastic Compute Cloud” as shown in figure 1.
Now on the EC2 dashboard, kindly search for the section with “Launch Instance” and click the button under it in order for us to start creating our EC2 as shown in Figure 2.
After clicking the Launch instance button, you will greeted with the first step of creating your EC2 which is selecting of type of operating system you need to consume as shown in Figure 3.
Not only you are being offered to select on the predefined Operating Systems from AWS but also you can select from either you own AMI, AWS Marketplace and from the Community as shown in Figure 4.
For this demo will use the Free tier only so don’t forget to tick the “Free tier only” checkbox so that we will not incur any charges. Kindly search for Windows on the search bar and it will display below the different Windows O.S. that is eligible for free tier as shown in Figure 5.
After you have selected for AMI we select the configurations needed for our EC2 run like the kind of storage, number of CPU, memory and network performance. Don’t forget to select the free tier eligibility as shown in Figure 6.
For this demo purposes we can already launch our Instance type with the default configurations for the free tier and click the button “Review and Launch” as shown in Figure 7. Just to mention the succeeding steps 3 to 6 AWS provides more customization to Taylor fit on what you need for your EC2. If you have more customization needed for your like additional storage, number of instance, adding of custom tags for maintenance and security groups.
The final step for creating and launching our EC2 is the review page which will show to you a summarize view of the different configurations you have for your EC2 as shown in Figure 8. If you need to update any configurations you can still do so at this point of time if none then you can click the Launch button for AWS to start creating your EC2 instance.
If this is your first time creating an EC2 instance then you will be asked to create key pair which will be used in accessing our EC2 instance as shown in Figure 9.
It is easy to create a key pair for our EC2, just type in the Key Pair Name and don’t forget to download the .PEM file which will be used to access our EC2 as shown in Figure 10.
After you have created the Key Pair for your EC2 you can then click the “Launch Instances” button for AWS to start creating it. You can now view your newly created EC2 under your EC2 dashboard as shown in Figure 11.
There are different ways in accessing your EC2, let’s try to access our EC2 instance through RDP. Kindly right click on your EC2 and select “Connect” as shown in figure 12.
Under the selection method kindly select standalone RDP client and click the Download Remote Desktop File which already configured to point to our EC2 as shown in Figure 13.
For the password of the RDP connection you need to decrypt the .PEM file that was created earlier for our Access Key pair. Click the “Get Password” button and open your .PEM file to decrypt it and it will show the Password needed for you to connect through RDP as shown in Figure 14.
Now let us try to access our EC2 by double clicking the RDP file downloaded earlier and the decrypted password from our .pem file as shown in Figure 15.
As you can see we have already accessed our EC2 through our RDP as shown in Figure 16. Don’t forget to always delete resource when trying out different services from AWS like this one the EC2 just to make sure you will not incur any future charges even though it is eligible under free tier.
Conclusion
For this article we’ve discussed one of AWS core services which is EC2 or Elastic Compute Cloud, what are the features or benefits using it and how to create and access our EC2 instance. This is just a quick dive about AWS EC2 and we haven’t even scratched the surface on the different features and different possibilities on integrating it with other AWS services.
Happy Coding 🙂