1
chap7
jason-zhu edited this page 2023-09-25 17:57:23 +10:00

Chapter 7: AWS Compute Services

AWS offers VMs in the cloud, called Elastic Compute Cloud or EC2

Introduction to Amazon EC2

Summary: Create a EC2 instance you need

  1. Select family, instance type, and instance size
  2. Attach a block storage to EC2
  3. Specify the subnet VPC that EC2 launched within

On physical computer, hypervisor softwares (e.g. VMware or Hyper-V) is used to create virtual resources (e.g. virtual servers)

AWS EC2 abstract underlying hypervisor layer from customer, so you DO NOT have direct access to hypervisor. Instead, using a self-service portal or API access, you can launch EC2 instances in your VPC.

AWS EC2 provide a selection of types and families.

  • family: generic use case of EC2 instance types contained within it.
    • general-purpose family: handle workloads that require balance of compute, memory and network.
  • Type: in each family, instance type offer different combinations of compute, memory, and storage capacities.
    • e.g.
      • T2 type runs on Intel Xeon processors
      • M5 runs on Xeon Platinum 8175 processors, up to 25 Gbps network bandwidth
  • In each type, there is instance size.
    • t2.micro (with 1 GB of memroy), t2.xlarge (with 16GB of memory and 4 vCPUs)

When select an EC2 instance for app, need to define family, type, and size of instance.

Besides, a block storage device (e.g. EBS or an instance-store volume) is needed to be attached to the EC2 instance. Each EC2 need at least 1 block storage to host OS and make VM bootable.

Amazon Machine Image (AMI) is also needed

  • AMI = a snapshots that contain base OS, utilities, and any app need to be configured within EC2

EC2 and VPC (as graph shown below)

  • EC2 instance are Region-specific, they are tied into a AZ it launched from.
  • a subnet of VPC need to be specified to launch EC2, the subnet is tied to a given AZ

Figure 7.1 - EC2 instance components

Amazon Machine Images (AMIs)

AMIs are AWS equivalent of VM images, containing baseline OS and required additional app. In reality, they are EBS snapshorts or a template of the root volume.

AWS offer pre-configured Quick Start AMIs, including UBUNTU, Windows etc.

You can create your own AMIs:

  • Prebaking an AMI = configure one EC2 instance, then create an AMI of it.
  • Benefit: quickly provision new instances without errors

Exploring EC2 instance types

AWS EC2 offer different VM configurations called instance type, they provide different specification:

  • Virtual CPUs (vCPUs)
  • memory
  • type of storage
  • networking configuration

core EC2 instance families:

  • General purpose: balance of compute, memory, and networking resources.
  • Compute optimized: high-performance processing.
    • Ideal for batch processing workloads, media transcoding, high-performance web serves, and high-performance computing (HPC)
  • Memory-optimized: process large datasets in memory
  • Accelerated computing: with hardware accelerators, or co-processors, to perform complex function.
    • Good at graphics processing, or data pattern matching.
  • Storage-optimized: computing that requires high sequential read and write access to large datasets on local storage.

EC2 instance types

Dedicated categories

Other than standard instances, Dedicated Instances & Dedicated Hosts are available. So you can fulfill any compliance or regulatory requirements that you cannot use EC2 instances on shared hosting.

  • Dedicated instances = an EC2 instance that's deployed in your VPC, on a physical hardware that's dedicated to you and not shared with other customers
  • Dedicated Host = a physical host dedicated for your use alone.
    • Offering additional control and management capabilities over how instances are placed on physical server

Learning about Amazon EBS and instance backed store

EC2 instances require accessible block storage volume to host OS, data, and app.

AWS offers 2 types of block storage options:

  • Elastic Block Store
  • Instance store volumes

Amazon Elastic Block Store

Learning about EC2 pricing options

Implementing Shared File Storage with Amazon EFS

Learning about VPSes with Amazon Lightsail

Introduction to Amazon ECS and Kubernets

Amazon Elastic Kubernets Service (Amazon EKS)

Learning about additional compute services on AWS

Understanding additional storage options in AWS

Securing your VPC with bastion hosts