Amazon Elastic Compute Cloud (EC2) provides resizable virtual servers called instances, billed by the second or hour. Customers choose an instance type from five main families: General Purpose (T, M series) for balanced workloads, Compute Optimized (C) for high-performance processors and batch processing, Memory Optimized (R, X) for fast access to large in-memory datasets, Storage Optimized (I, D, H) for high sequential read or write to local storage, and Accelerated Computing (P, G) for GPU workloads such as machine learning and graphics rendering. An Amazon Machine Image (AMI) supplies the software configuration—operating system, application server, and applications—and can come from AWS (Amazon Linux, Ubuntu, Windows), the AWS Marketplace, or a customer's own golden image. AMIs are region-specific but can be copied across regions. Security Groups act as stateful virtual firewalls attached at the instance (ENI) level, allowing only permissive rules and automatically permitting return traffic. Key Pairs combine a public key stored by AWS with a private key you download for SSH access; if the private key is lost, it cannot be recovered. Amazon Elastic Block Store (EBS) provides persistent block-level storage in types tuned for different workloads: General Purpose SSD (gp3/gp2), Provisioned IOPS SSD (io2/io1) for databases, Throughput Optimized HDD (st1) for big data, and Cold HDD (sc1) for infrequent access. EBS volumes are tied to a single AZ but can be snapshotted to S3 for backups.
EC2 Auto Scaling complements EC2 by adjusting the number of instances to match demand through launch templates, Auto Scaling Groups with min/max/desired capacity, and scaling policies (target tracking, step, or simple). Cooldown periods (default 300 seconds) prevent the rapid fluctuation known as thrashing by blocking additional launch or terminate decisions until metrics stabilize. AWS Elastic Beanstalk layers a PaaS experience on top of EC2 and friends: developers upload code and Beanstalk handles capacity provisioning, load balancing, health monitoring via CloudWatch, and patching, while leaving full control over the underlying resources available for those who need it.
AWS Lambda is the serverless counterpart: event-driven functions in Node.js, Python, Java, Go, .NET, or Ruby that scale from zero to thousands of concurrent executions, billed by the millisecond, with a maximum runtime of 15 minutes and up to 10 GB of memory. Common triggers include API Gateway for HTTP, S3 for object events, DynamoDB Streams for table changes, SQS for queue messages, EventBridge for scheduled or event-driven rules, and SNS for notification fanout. A cold start happens when Lambda must initialize a fresh execution environment; mitigation strategies include Provisioned Concurrency to keep instances warm, choosing lighter runtimes such as Python or Node.js over Java, minimizing deployment package size, and warming functions with scheduled pings. Lambda Layers are ZIP archives of shared libraries that promote code reuse and keep deployment packages small, with up to five layers per function and a combined unzipped size limit of 250 MB. Other Lambda constraints worth remembering include the 50 MB compressed limit for direct zip upload (250 MB via S3), the 10 GB limit for container images, the 1,000 concurrent execution default quota (raised via Reserved Concurrency caps and Provisioned Concurrency warmth), the 512 MB ephemeral /tmp disk, the 4 KB environment variable budget, and the well-known VPC cold start penalty that AWS mitigates through shared ENIs in Hyperplane.
Container workloads run on Amazon Elastic Container Service (ECS) or Amazon Elastic Kubernetes Service (EKS), each supporting both EC2-based and fully managed Fargate compute. ECS uses Task Definitions, Services, and Clusters, while EKS runs the Kubernetes control plane across multiple AZs and supports EKS Add-ons, EKS Anywhere for on-prem, and the EKS Connector for hybrid visibility. Fargate defines CPU and memory per task or pod, charging per vCPU/GB-hour consumed without any EC2 to manage. Amazon Elastic Container Registry (ECR) hosts OCI images with IAM-controlled access, vulnerability scanning (Basic on push or Enhanced continuous), and at-rest encryption with KMS. Beyond instances and containers, AWS Batch dynamically provisions EC2, Spot, or Fargate resources to run Docker batch jobs with priority-based scheduling. Amazon Lightsail offers VPS-style bundles under five dollars per month for simple sites and learning. AWS Outposts brings native AWS hardware into on-prem data centers for low-latency and data-residency use cases, AWS Local Zones place compute and storage close to population centers that lack a Region for sub-ten-millisecond latency, and AWS Wavelength embeds AWS at telecom 5G edges to serve single-digit-millisecond applications like AR/VR and IoT.