Cloud Security For Beginners: Introduction To Amazon EC2

Instances are categorized by the diverse capabilities that they provide for your workloads:

  1. General Purpose
  2. Compute Optimized
  3. Memory Optimized
  4. Storage Optimized
  5. Accelerated Computing

The table above summarizes the different types of EC2 instances and the applications for which they are designed.

Amazon Elastic Container Service (Amazon ECS) is a highly scalable and fast container management service. You can use it to run, stop, and manage containers on a cluster. With Amazon ECS, your containers are defined in a task definition that you use to run an individual task or task within a service. In this context, a service is a configuration that you can use to run and maintain a specified number of tasks simultaneously in a cluster. You can run your tasks and services on a serverless infrastructure that’s managed by AWS Fargate. Alternatively, for more control over your infrastructure, you can run your tasks and services on a cluster of Amazon EC2 instances that you manage.

Launch types
There are two models that you can use to run your containers:

Fargate launch type – This is a serverless pay-as-you-go option. You can run containers without needing to manage your infrastructure.

EC2 launch type – Configure and deploy EC2 instances in your cluster to run your containers.

The Fargate launch type is suitable for the following workloads:

– Large workloads that need to be optimized for low overhead

– Small workloads that have occasional burst

– Tiny workloads

– Batch workloads

The EC2 launch type is suitable for the following workloads:

– Workloads that require consistently high CPU core and memory usage

– Large workloads that need to be optimized for price

– Your applications need to access persistent storage

– You must directly manage your infrastructure

Choosing the Right EC2 Instance Type for Your Application

Amazon EC2 (Elastic Compute Cloud) instances provide virtual computing capacity in the AWS cloud. The elasticity refers to the ability of users to scale their compute power up or down, on demand, to handle changes in requirements.  

AWS has a vast number of EC2 instance types designed for a multitude of workloads. As of the date of this article, there are close to 300 EC2 instance types, spanning 70 Availability Zones in 22 regions, giving users endless combinations to choose from.

How can you decide which EC2 instance is best for you?

Choose the EC2 instance mix based on the type of applications you are developing and running on AWS, with the optimum CPU, memory, storage, and networking capacity required for your specific workload.

To help you get started with launching your instances, AWS provides a preconfigured template, called Amazon Machine Image (AMI). AMI defines your operating environment and the required software to package the components you need for your server. You can terminate and change the type of instances later as your business and application needs change.

For further information on how to set up an EC2 instance you can refer to this tutorial.

To help you choose the appropriate EC2 instance we will review each instance type that address different workloads and use cases.

Instances are categorized by the diverse capabilities that they provide for your workloads:

  1. General Purpose
  2. Compute Optimized
  3. Memory Optimized
  4. Storage Optimized
  5. Accelerated Computing

1. AWS General Purpose Instances

General purpose instances provide a blend of compute, memory and networking resources. These instances are ideal for business critical applications, small and mid-sized databases, web servers and code repositories.

The latest generation of these instance types within this family are the following:

A1 instances are used for scale-out and Arm-based applications.

T instances (T2, T3, T3a)  are burstable, meaning that they are designed to sustain temporary spikes in CPU performance for applications with moderate CPU usage. If the instance needs to run at higher CPU utilization for a prolonged period, it can do so at a flat additional charge per vCPU-hour.

T2 instances are used for websites and web applications, development environments, build servers, code repositories, micro services, test and staging environments, and line of business applications.  

T3, T3a instances are best for micro-services, low-latency interactive applications, small and medium databases, virtual desktops, development environments, code repositories, and business-critical applications

M4, M5, M5a and M6g instances are designed for applications built on open-source software such as web and application servers, microservices, gaming servers, small and mid-size databases, cluster computing and caching fleets.

2. AWS Compute Optimized Instances

Compute Optimized instances are designed for compute-intensive applications that require high performance processors, such as batch processing workloads, media transcoding, high performance web servers, high performance computing (HPC), scientific modeling, dedicated gaming servers and ad server engines and machine learning inference.

The latest generation types in this family are the following:

C5 instances are ideal for high performance computing and applications, such as ad serving, highly scalable multiplayer gaming, video encoding, scientific modelling, distributed analytics. C5n variant is designed for network intensive applications.

C4 instances are best for high performance front-end fleets, web-servers, batch processing, distributed analytics, high performance science and engineering applications, ad serving, MMO (Massively Multiplayer Online) gaming, and video-encoding.

3. AWS Memory Optimized Instances

Memory optimized instances are designed to deliver fast performance for workloads that process large data sets in memory.

The latest generation of memory optimized instances in this category are as follows:

R5 and R5a instances are well suited for memory intensive applications such as high performance databases, distributed web scale in-memory caches, mid-size in-memory databases, real time big data analytics, and other enterprise applications.

R4 instances are optimized for memory-intensive applications, such as high performance databases, data mining & analysis, in-memory databases, distributed web scale in-memory caches, applications performing real-time processing of unstructured big data, Hadoop/Spark clusters, and other enterprise applications.

X1 and X1e instances are optimized for high-performance databases, in-memory databases and other memory intensive enterprise applications.

High memory instances are purpose built to run large enterprise databases, including production deployments of SAP HANA, in the cloud. z1d instances are best for electronic design automation (EDA), gaming, Optical Proximity Correction (computational lithography), HPC, financial, actuarial, data analytics, and certain relational database workloads with high per-core licensing costs. z1d is also ideal for applications that require high single-threaded performance and high memory usage.

4. AWS Storage Optimized Instances

Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.

I3 and I3en instances are the next generation of storage optimized instances for high transaction, low latency workloads, non-relational NoSQL databases for mobile web and gaming, in-memory databases, data warehousing, Elasticsearch, and analytics workloads.

H1 instances are a new generation of Amazon EC2 Storage Optimized instances designed for applications that require low cost, high disk throughput and high sequential disk I/O access to very large data sets. They are also used for MapReduce-based workloads, distributed file systems such as HDFS and MapR-FS, network file systems, log or data processing applications such as Apache Kafka, and big data workload clusters.

The new D2 instances are designed for Massively Parallel Processing (MPP) data warehousing, MapReduce and Hadoop distributed computing, distributed file systems, network file systems, log or data-processing applications.

5. AWS Accelerated Computing Instances

Accelerated computing instances use co-processors to perform functions, such as floating point number calculations, graphics processing, or data pattern matching, more efficiently than is possible in software running on CPUs.

P3 instances are the latest generation of general purpose GPU instances used for machine/Deep learning, high performance computing, computational fluid dynamics, computational finance, seismic analysis, speech recognition, autonomous vehicles, drug discovery, molecular modeling, genomics, and rendering workloads.

P2 instances are designed for general-purpose GPU compute applications, such as machine learning, high performance databases, computational fluid dynamics, computational finance, seismic analysis, molecular modeling, genomics, rendering, and other server-side GPU compute workloads.

Inf1 instances support machine learning inference applications, such as recommendation engines, forecasting, image and video analysis, advanced text analytics, document analysis, voice, conversational agents, translation, transcription, and fraud detection.

G4 instances are designed to help accelerate machine learning inference for applications like adding metadata to an image, object detection, recommender systems, automated speech recognition, and language translation. G4 instances are also used for building and running graphics-intensive applications, such as remote graphics workstations, video transcoding, photo-realistic design, and game streaming in the cloud.  

G3 instances are optimized for graphics-intensive applications, such as 3D visualizations, graphics-intensive remote workstation, 3D rendering, application streaming, video encoding, and other server-side graphics workloads.

F1 instances offer customizable hardware acceleration for use cases such as genomics research, financial analytics, real-time video processing, big data search and analysis, and security.