Understanding AWS Compute Fundamentals: AWS Elastic Compute Cloud (EC2)

Understanding AWS Compute Fundamentals: AWS Elastic Compute Cloud (EC2)

On your first dive into the AWS infrastructure, the first piece of infrastructure you may come across is the AWS Elastic Compute Cloud.

The AWS Elastic Compute Cloud works within the compute system of the AWS infrastructure. All the components of the compute system make up what we now refer to as the AWS Compute Resources.

What are AWS compute Resources?

AWS Compute Resources are the processing powerhouse of the AWS infrastructure. These resources help applications to work on computational tasks with several instructions.

AWS Compute resources also work with the common server components such as CPUs and RAM. With these compute resources, you can configure many CPUs, work with many gigs of RAM, and process complex instructions.

In AWS, there are several features that the compute resources provide to power your application. Asides from the EC2 instances that we mentioned before, there are other resources that you can consume for your software application.

In this piece, let’s look at some of the services in AWS that are part of the compute resource. The first one is the Elastic Compute Cloud (EC2)

aws_logo_smile_1200x630.png

AWS Elastic Cloud Compute (EC2)

As we stated earlier, the AWS EC2 is one of the first services you may encounter when working with AWS. This service allows you to deploy virtual servers in your AWS environment, and as a cloud engineer, you may need an EC2 instance for at least one part of your development.

There are several components of the EC2 instances that we are going to further break down for you. Some of these components include the Amazon Machine Images, the instance Types, the instance purchasing options, tenancy, user data, security, and storage options.

Amazon Machine Images.

The Amazon Machine Imagines are pre-configured instances that help you launch a new instance based on a configuration from the AMI. With the AMI, you can get a custom configuration for your application on an existing operating system.

In AWS, AMIs come with different operating systems including Linux, and Windows, and a good AMI configuration will help you speed up your deployment processes.

Instance Types

The instance type is the size of the instance based on different parameters. These instance types in the AWS infrastructure define the compute units that you can work with on EC2. Within the instance types, you can select the number of vCPUs, Physical processors, Clock Speed, Memory, Network performance, and process architecture.

When configuring your instance types in EC2, you need to pay attention to vCPUs, network performance, instant storage, and memory. However, it depends on the kind of application you intend to deploy.

Within the instance type, you can configure instance families. Some of these instance families include Micro instances, General Purpose, Memory-optimized, and GPU. Micro instances have low costs because of the low rate of CPU and memory they offer. Cloud engineers use this for low-traffic websites and applications with very low throughput.

The General purpose instance has a good mix of CPU, memory, and storage, for small to medium-scale database systems. The GPU instance helps developers deploy graphics-intensive applications. Memory-optimized instances are used for large-scale enterprise applications.

Instance Purchase options.

With the Instance purchasing options, you can get EC2 instances using a variety of payment plans. There are different payment options available. There are the on-demand instances, the scheduled instances, and the spot instances. Based on AWS user statistics, many AWS users work with on-demand instances for their testing, and development environments, and when you terminate the instance, you stop paying for the resource.

Reserved instances

Reserved instances allow you to purchase a discount on your instance type in return for the reduced cost computed to the on-demand instances. This reduction is as much as 75%. You can purchase Reserved instances with three options available to you. All upfront, the partial Upfront, and no upfront. These instances are used for long-term and predictable workloads that help you utilize costs on your Ec2 instance.

Scheduled instances.

Just like a reserved instance, you can use scheduled instances to pay for reservations for an instance. You can do this either weekly, monthly, or even daily. With these scheduled instances, you can set up an instance to work during a particular timeframe, and it does not incur a high price. These instances enable you to provision instances only for workloads that you need.

EC2 tenancy.

EC2 tenancy helps to describe what host your EC2 instance will be based on. Here, there is the shared tenancy, and there is the dedicated tenancy. With the shared tenancy, you can choose to launch your EC2 instance on an available instance, with specific resources based on your instance type. This does not affect customers and users also running EC2 instances on the same host due to AWS's advanced security mechanisms.

Dedicated tenancy, on the other hand, offers you dedicated instances, and dedicated hosts. This simply means that they are hosted on hardware that no other customer can access, except your AWS account. For security reasons, dedicated instances are more secure but they incur additional charges.

Use data

The user data in the EC2 instance allows you to enter commands that will run immediately when the boot cycle begins. In this section, you can automatically perform a function when the instances boots. After selecting the user data, you will be asked to configure storage requirements.

Storage.

Storage in EC2 can be classified into two categories. The first one is the persistent storage, and ephemeral storage. Persistent storage works by attaching EBS volumes to the instance. Ephemeral storage is physically attached to the host on which the EC2 instance is on.

The main difference between Persistent storage, and Ephemeral storage is that in ephemeral storage, all the saved data is lost once the instance is stopped.

Therefore, if you have data that you need to retain, persistent storage will be a better option for you.

Security

Security is a vital, and fundamental part of your AWS infrastructure. During the creation of your AWS instance, you will be asked to select a security group for your instance. A security group is defined as a firewall on the instance that allows you to restrict the ingress and egress traffic. With these restrictions, you can set the traffic that is allowed to go through.

As part of the security protocol, you will need a key pair. A key pair is made up of two components which are a public key, and a private key. The main job of the key pair is encrypting the login information, to restrict access to the instance. You will be allowed to download the key pair. You must keep it safe until you are ready to log in.

Final Words.

In the article, we have covered the essential parts of the AWS EC2 instance that will help you create and manage your instance with ease. In the next section of this series, we will discuss the Elastic Container Service.