All services

Compute

Amazon EC2

Resizable virtual servers in the cloud.

Official docs

Overview

Elastic Compute Cloud (EC2) provides secure, resizable compute capacity. You launch virtual machines (instances) with the OS, CPU, memory, storage and network performance you choose, paying only for what you use.

When to use it

  • Hosting traditional web apps, APIs or backends that need full OS control
  • Lift-and-shift of on-prem workloads
  • Running test agents, build runners, or load generators
  • Workloads requiring custom kernels, GPUs, or specialized AMIs

Setup

  1. Sign in to AWS Console → EC2 → Launch Instance.
  2. Choose an AMI (e.g. Amazon Linux 2023, Ubuntu 22.04).
  3. Pick an instance type (t3.micro for free tier, m6i for general production).
  4. Create or select a Key Pair for SSH access.
  5. Configure VPC, subnet and a Security Group (open 22 for SSH, 80/443 for web).
  6. Attach EBS volume and review → Launch.

How to use

Connect via SSH
ssh -i my-key.pem ec2-user@<public-ip>
Launch an instance with AWS CLI
aws ec2 run-instances \
  --image-id ami-0abcdef1234567890 \
  --instance-type t3.micro \
  --key-name my-key \
  --security-group-ids sg-0123 \
  --subnet-id subnet-0123
Stop / Terminate
aws ec2 stop-instances --instance-ids i-0123
aws ec2 terminate-instances --instance-ids i-0123

Stopping keeps the EBS volume; terminating deletes it (unless DeleteOnTermination=false).

QA use cases

  • Spin up dedicated Selenium/Playwright grid nodes on EC2 for parallel UI tests.
  • Host JMeter / k6 load-generator fleets in an Auto Scaling Group.
  • Run nightly regression suites on a scheduled EC2 instance triggered by EventBridge.