Compute services

From a server you manage to a function you only write

ServiceWhat you getHow much you manageYou payAmazon EC2virtual serversper second, while runningElastic Beanstalkupload a web app; AWS builds the restfor the resources it createsECS or EKS on EC2containers on your serversfor the serversAWS Fargatecontainers, no servers to manageper second of CPU and memoryAWS Lambdaa function that runs on an eventper request and millisecondbars are relative, not measuredAWS compute runs from a server you manage to a function you only write.Further down the list, AWS manages more and you pay only while work is done. "Serverless" on the exam means thelast two: Fargate for containers and Lambda for functions. Lambda runs for at most 15 minutes, so long jobs goelsewhere. "Least operational overhead" points down the list; "full control of the operating system" points to EC2.

EC2 gives you a server. Fargate and Lambda are serverless: nothing to manage.

Compute services · Going deeper

Clue words for compute

When the question saysThe service isBecause it"full control of the operating system"Amazon EC2a virtual server"run code without servers", "event-driven"AWS Lambdafunctions, up to 15 minutes"containers without managing servers"AWS Fargateserverless containers"Kubernetes"Amazon EKSmanaged Kubernetes"just deploy my web application"AWS Elastic Beanstalkplatform as a service"simple server, fixed monthly price"Amazon Lightsailbundled virtual private server"thousands of batch jobs"AWS Batchschedules and runs batch work"AWS in our own data centre"AWS OutpostsAWS hardware on premisesEvery compute question is one of these eight clues. Read for the phrase, not the story.

Eight compute services, eight clue phrases.

EC2 instance types

Five families, each named for what it has most of

FamilyLettersIt has most ofUse it forGeneral purposeT, Ma balance of CPU, memory and networkweb servers, small databases, developmentCompute optimizedCmore processor per unit of memorybatch processing, game servers, scientific modellingMemory optimizedR, Xa great deal of memoryin-memory databases, real-time big dataStorage optimizedI, Dfast local disks, very high input/outputdata warehouses, large NoSQL databasesAccelerated computingP, GGPUs and other acceleratorsmachine learning, graphics, videoFive instance families, each named for the resource it has most of.The exam describes a workload and asks for the family. Match the bottleneck: a workload limited by processorwants compute optimized; one that holds everything in memory wants memory optimized. You do not need tomemorise the letters, only to recognise the five names.

Match the workload's bottleneck to the family: compute, memory, storage or accelerated.

EC2 instance types · Going deeper

Reading an instance name

Reading an instance typem7g.xlargefamilygenerationprocessorsizem = general purpose7 = seventh generationg = AWS Graviton (Arm) processorxlarge = 4 vCPU, 16 GiB in this familyOther EC2 terms the exam usesAmazon Machine Image (AMI)the template an instance is launched from: operating system and softwareEC2 Auto Scalingadds and removes instances to match demand: elasticityAWS Compute Optimizerrecommends a better instance type from real usage: rightsizingTenancyshared by default; Dedicated Instances and Dedicated Hosts isolate hardwareEach size up doubles the vCPUs and memory, and roughly doubles the price.

m7g.xlarge: family, generation, processor, size.

Containers

ECS or EKS orchestrates; EC2 or Fargate provides the servers

Amazon ECSAWS's own orchestrator: simplerAmazon EKSmanaged Kubernetes: portableOn EC2you manage the serversOn Fargateserverless: no serversECS on EC2control and reserved pricingEKS on EC2Kubernetes with full controlECS on Fargateleast to operateEKS on FargateKubernetes without nodesAmazon ECRthe registry: storescontainer imagesTwo choices make four options: which orchestrator, and who runs the servers underneath.ECS or EKS is the orchestrator: it decides where containers run and restarts them. EC2 or Fargate is the capacity:your servers or none. ECR is neither; it only stores images. "Kubernetes" in a question means EKS. "Containerswithout managing servers" means Fargate.

EKS is Kubernetes, ECS is AWS's own, Fargate removes the servers, ECR stores images.

Check yourself

uploadevent2 secondsof workresized

A function resizes an image each time one is uploaded. It runs for two seconds, a few hundred times a day. Which service fits best?

Elasticity

Auto Scaling sets the number; the load balancer shares the load

UsersElastic LoadBalancingAUTO SCALING GROUP, across two Availability Zonesmin 2 · max 8always onadded when average CPU passes 60%, removed when it fallsunhealthy instances are replaced automaticallyAuto Scaling changes how many servers there are. The load balancer shares the work among them.They do different jobs and are almost always used together. Auto Scaling provides elasticity: it launches instanceswhen demand rises and terminates them when it falls, between a minimum and a maximum. Elastic Load Balancingdistributes requests across healthy instances in several zones, which gives high availability.

Auto Scaling provides elasticity. Elastic Load Balancing distributes traffic to healthy targets.

Elasticity · Going deeper

Kinds of load balancer and ways to scale

Load balancerWorks atUse it forApplication Load Balancerlayer 7: HTTP and HTTPSweb applications; routes by path or host nameNetwork Load Balancerlayer 4: TCP and UDPextreme performance, static IP addressesGateway Load Balancerlayer 3: IP packetsfleets of third-party firewalls and appliancesWays to scaleScale out and in (horizontal)add or remove instances: what Auto Scaling doesScale up and down (vertical)change to a bigger or smaller instance typeTarget trackingkeep a metric, such as CPU, near a target valueScheduled scalingadd capacity at a known time, such as 9 a.m. on weekdaysThe exam asks only for "the purposes of load balancers" and that "auto scaling provides elasticity".

Application load balancers for HTTP; Network load balancers for raw speed.

VPC

Your private network: subnets, route tables and gateways

VPC 10.0.0.0/16: your private network in one RegionPublic subnetLoad balancerNAT gatewayPrivate subnetApp serversDatabaseInternetinternet gatewayoutbound only, through NATYour officeVPN orDirect ConnectA VPC is your own private network. A subnet is public only if it has a route to an internet gateway.Subnets divide the VPC, one Availability Zone each. Public subnets hold what must face the internet, such as loadbalancers. Private subnets hold servers and databases; they reach out for updates through a NAT gateway, andnothing outside can start a connection to them.

A subnet is public only when it routes to an internet gateway; private subnets go out through NAT.

VPC · Going deeper

Security groups and network ACLs

Security groupNetwork ACLGuardsan instance (its network interface)a whole subnetRulesallow onlyallow and denyStatestateful: replies are let back automaticallystateless: replies need their own ruleDefaultdenies all inbound, allows all outboundthe default ACL allows everythingUse it tosay who may reach this serverblock an address range from a subnetAmazon Inspectoris listed by the exam guide under VPC security: it reports instances that arereachable from the internet and have known vulnerabilities.Security group: instance, stateful, allow only. Network ACL: subnet, stateless, allow and deny.This comparison is asked more often than anything else in task 3.5. "Block a specific IP address" needs a deny rule, so it is the network ACL.

Security group: instance, stateful. Network ACL: subnet, stateless, can deny.

Check yourself

Subnet198.51.100.0/24must be blocked

An address range must be blocked from reaching anything in one subnet. Which control can do it?

Connecting to AWS

A VPN crosses the internet; Direct Connect goes around it

Your data centreYOUR VPCAWS Site-to-Site VPNan encrypted tunnel over the public internetready in minutes · speed varies with the internetAWS Direct Connecta dedicated private line, not over the internettakes weeks to install · consistent speed and latencyA VPN goes over the internet, encrypted. Direct Connect goes around it, on a private line.Both join your network to your VPC for a hybrid setup. Choose the VPN for speed of setup and low cost. ChooseDirect Connect for large, steady data flows and predictable performance. Clue words: "dedicated", "private","consistent" mean Direct Connect; "quickly", "encrypted over the internet" mean VPN.

Site-to-Site VPN: encrypted, over the internet, fast to set up. Direct Connect: dedicated and private.

Connecting to AWS · Going deeper

Clue words for networking

When the question saysThe service isBecause it"remote employees connect from laptops"AWS Client VPNa VPN for individual users"connect two VPCs privately"VPC peeringone-to-one link between VPCs"hub for many VPCs and on-premises networks"AWS Transit Gatewayone central router"reach a service without using the internet"AWS PrivateLinkprivate endpoints inside your VPC"translate domain names", "register a domain"Amazon Route 53DNS, health checks, routing policies"cache content at the edge"Amazon CloudFrontcontent delivery network"static IP addresses, AWS global network"AWS Global Acceleratorfaster, steadier path to your app"create, publish and secure APIs"Amazon API Gatewaya managed front door for APIsCloudFront caches content. Global Accelerator does not cache; it finds a better network route.

Transit Gateway is the hub; PrivateLink keeps traffic off the internet.

Route 53

It answers "where?", and never carries the traffic

A user1 where is shop.example.com?Amazon Route 53DNS2 the address of a healthy endpoint3 the request itselfCloudFrontedge cacheLoad balancerServersRoute 53 can also✓register the domain name✓check health and fail over to a second Region✓route by latency, geography or weightRoute 53 only answers "where?". It never carries the traffic.DNS turns a name into an address, and that is all. Route 53 is AWS's DNS service; the name comes from port 53.Because it chooses which address to give out, it is also how users are steered to the nearest or the healthiestRegion. CloudFront then serves cached content from the edge.

Amazon Route 53 is DNS: names to addresses, with health checks and routing policies.

Check yourself

Data centrededicated · private · consistentAWS

A company needs a private, dedicated connection from its data centre to AWS with consistent performance. Which service?

Lesson complete

You finished “Compute and networking on AWS”

Answer the questions along the way to see your score here.

Open in a new tab