AWS · 101 Guide
AWS 101 — the mental model, core services, and your first deploy
A teach-it-from-scratch guide to Amazon Web Services for technical newcomers: regions, IAM, compute, storage, networking, databases, cost control, observability, and a copy-ready first deploy you tear down at the end.
01What AWS is, and the mental model
Amazon Web Services rents you computers, storage, and networking by the second or the gigabyte, through an API. You never see the hardware. Once four ideas click, the other ~250 services stop looking like noise.
Regions and Availability Zones
AWS runs in Regions — independent geographic areas like us-east-1 (N. Virginia) or eu-west-1 (Ireland). Pick the one nearest your users; data and most services do not cross Regions unless you make them. Each Region holds 3+ Availability Zones (AZs) — physically separate datacenters with independent power and networking, linked by low-latency fiber. The core reliability rule: spread across AZs so one datacenter failure doesn't take you down.
Three ways to drive AWS
- Console — the web UI. Great for learning and one-offs, terrible for anything you need to repeat.
- CLI / SDK —
aws ...commands and language SDKs. Scriptable, reproducible. - Infrastructure as Code (IaC) — CloudFormation or Terraform describe your whole stack in a file you version-control. This is how real teams manage AWS; the Console is for looking, not building.
Shared responsibility
AWS secures the cloud of the cloud (hardware, hypervisor, managed-service internals). You secure what you put in it: your IAM policies, who can log in, patching your EC2 OS, and not leaving a storage bucket public. Most breaches are customer-side misconfiguration, not AWS being hacked.
Pay per use
There's no monthly license. You pay for what runs: instance-seconds, GB stored, GB of data leaving AWS. The upside is elasticity; the trap is forgetting something is running. A thing you launch and forget keeps billing until you delete it.
02Accounts & organization
An AWS account is the top-level container and the hard security and billing boundary. Everything — resources, IAM, the bill — lives inside one account identified by a 12-digit ACCOUNT_ID.
Don't run everything in one account
The modern best practice is multiple accounts, not one giant account with everything mixed together. Separate accounts give you blast-radius isolation (a mistake in dev can't touch prod), clean per-environment billing, and simpler permissions.
AWS Organizations
AWS Organizations lets one management account create and govern many member accounts for free, with one consolidated bill. You group accounts into Organizational Units (OUs) — e.g. a Workloads OU holding dev, staging, and prod accounts, and a Security OU for logging and audit.
- Service Control Policies (SCPs) are guardrails attached to an OU that cap what anyone in those accounts can do — even the account root. Example: deny creating resources outside approved Regions.
- Use AWS Control Tower or an Organizations-based landing zone to bootstrap this structure with sane defaults instead of wiring it by hand.
Protect the management account. Enable MFA on its root user, never run workloads in it, and use it only for org administration.
03Identity & access (IAM)
IAM (Identity and Access Management) controls who can do what. It's the service you'll misconfigure first, so learn its shape.
The building blocks
- Users — long-lived identities for humans or scripts. Minimize these; prefer federated SSO (IAM Identity Center) for people.
- Roles — identities with no password that are *assumed* temporarily. Your EC2 instance, Lambda function, or a human from SSO all get permissions by assuming a role. Roles are the right default because their credentials are short-lived.
- Policies — JSON documents listing allowed/denied actions (
s3:GetObject) on resources (a bucket ARN), optionally with conditions. - STS (Security Token Service) mints the temporary credentials behind every assumed role.
How a request actually resolves
When a principal calls an API, AWS evaluates all applicable policies: an explicit `Deny` always wins; otherwise you need an explicit `Allow`; the default is deny. SCPs, identity policies, and resource policies must all permit the action.
Least privilege
Grant only the actions a workload needs, then widen if something breaks. Avoid attaching AdministratorAccess to everyday roles. A policy snippet:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::MY_BUCKET/*"
}]
}Never bake access keys into code or commit them. On AWS, use roles; locally, use aws configure sso or short-lived credentials.
04Compute — the main ways to run code
Three families, roughly in order of how much you manage:
EC2 — virtual machines
Elastic Compute Cloud gives you a full Linux/Windows server you control. Pick an instance type (t3.micro for tiny, m general-purpose, c compute, r memory). You own the OS, patching, and scaling. Choose EC2 when you need full control, legacy software, GPUs, or long-running stateful processes.
- Pricing models: On-Demand (flexible, priciest), Savings Plans / Reserved (commit 1–3 yrs, big discount), Spot (up to ~90% off but can be reclaimed — great for fault-tolerant batch).
Containers — ECS and EKS
Package your app in Docker, run it managed:
- ECS — AWS's own orchestrator, simplest path.
- EKS — managed Kubernetes; choose it when you're already standardized on k8s.
- Fargate — serverless capacity for either; you don't manage any EC2 hosts. Choose containers when you want portability and microservices without babysitting servers.
Lambda — serverless functions
Lambda runs your function on an event (HTTP via API Gateway, an S3 upload, a queue message). No servers, scales to zero, you pay per request and GB-second. Choose Lambda when work is event-driven, spiky, or glue code. Watch the constraints: up to 15-min execution and a cold-start on first invoke.
Rule of thumb: event-driven or unpredictable → Lambda; standard web services → containers on Fargate; full control or special hardware → EC2.
05Storage — object, block, and file
Match the storage shape to the access pattern.
S3 — object storage (the default durable store)
Simple Storage Service holds files ("objects") in buckets with essentially unlimited capacity and eleven nines of durability. It's where almost everything lands: backups, static sites, data lakes, logs. Accessed over HTTPS, not mounted as a disk.
- Storage classes / lifecycle: keep hot data in S3 Standard; auto-tier unknown patterns with Intelligent-Tiering; move cold data to Glacier classes for archival pennies. A lifecycle rule transitions or expires objects on a schedule.
- Security: buckets are private by default and Block Public Access is on — leave it on unless you deliberately serve a public site.
EBS — block storage
Elastic Block Store is a virtual disk attached to one EC2 instance in one AZ — your root volume and databases. It behaves like a hard drive, survives instance stop/start, and you snapshot it to S3 for backup.
EFS / FSx — file storage
EFS is a managed NFS file system many instances can mount at once, across AZs — use it for shared files and lift-and-shift apps expecting a POSIX filesystem. FSx covers Windows (SMB) and high-performance workloads.
Pick: app data and assets → S3; a boot/database disk for one VM → EBS; a shared mount for many VMs → EFS.
06Networking — the virtual network model
A VPC (Virtual Private Cloud) is your private, isolated network in a Region, defined by a CIDR block like 10.0.0.0/16.
Subnets, public vs private
You carve the VPC into subnets, each living in one AZ.
- A public subnet has a route to an Internet Gateway (IGW) — put load balancers and bastion hosts here.
- A private subnet has no direct inbound internet path — put app servers and databases here. For them to reach out (updates, APIs) they go through a NAT Gateway sitting in a public subnet. **Cost flag: NAT Gateways bill hourly *and* per-GB processed — a classic surprise line item.**
Routing and firewalls — two layers
- Route tables decide where traffic goes (local, IGW, NAT).
- Security Groups are stateful firewalls on each resource — you write *allow* rules (e.g. allow
443from anywhere, allow5432only from the app's security group). Return traffic is automatic. - Network ACLs are stateless, subnet-level rules — a coarser backstop most teams leave at defaults.
Getting traffic in
- Application Load Balancer (ALB) — layer 7, routes HTTP/HTTPS by path/host; the usual choice for web apps.
- Network Load Balancer (NLB) — layer 4, ultra-high throughput and static IPs for TCP/UDP.
Standard pattern: ALB in public subnets → app servers in private subnets → database in private subnets, each locked down to only the security group above it.
07Databases — managed, so you don't run them yourself
Let AWS handle backups, patching, and failover instead of running a database on raw EC2.
Relational — RDS and Aurora
RDS (Relational Database Service) runs managed PostgreSQL, MySQL, MariaDB, Oracle, or SQL Server. Enable Multi-AZ and it keeps a synchronous standby in another AZ for automatic failover. Aurora is AWS's cloud-native MySQL/PostgreSQL-compatible engine — higher performance and a storage layer replicated across three AZs; Aurora Serverless v2 scales capacity automatically. Use RDS/Aurora as your default for anything with relationships, joins, and transactions.
NoSQL — DynamoDB
DynamoDB is a fully managed key-value/document store with single-digit-millisecond latency at any scale and no servers to manage. Choose it when you have a known access pattern, need massive scale, or want serverless pay-per-request — but design around its key model; it's not for ad-hoc SQL joins.
Cache — ElastiCache
ElastiCache runs managed Redis or Memcached in front of your database to absorb hot reads and hold sessions. Reach for it when read load or latency becomes the bottleneck.
Pick: transactions and joins → RDS/Aurora; huge scale with simple lookups → DynamoDB; speed up reads → ElastiCache.
08Billing & cost control
You're billed per resource per unit of time or usage, summed across the account and consolidated across the Organization.
What surprises people
- Data transfer / egress — moving data out to the internet or across Regions costs money; inbound is usually free. This quietly dominates some bills.
- NAT Gateway — hourly + per-GB, as noted; idle environments still pay the hourly charge.
- Forgotten resources — a stopped EC2 still bills for its EBS volume and any Elastic IP; old snapshots and unused load balancers accrue silently.
- Cross-AZ traffic — chatty services in different AZs incur per-GB charges.
Guardrails to set on day one
- AWS Budgets — set a monthly budget with email/SNS alerts at 50/80/100%. Do this before you deploy anything.
- Cost Explorer — visualize and break down spend by service, Region, and tag over time.
- Tagging — put consistent tags (
Environment,Project,Owner) on every resource so Cost Explorer can attribute spend. Enforce with tag policies. - Free Tier — many services have a 12-month or always-free allowance; it's enough to follow this guide, but it's not unlimited — budgets still matter.
09Observability — where logs and metrics live
Two services answer "what's happening" and "who did what."
CloudWatch — metrics, logs, alarms
CloudWatch is the default home for operational telemetry:
- Metrics — CPU, request counts, latency, Lambda invocations, custom app metrics.
- Logs — application and Lambda output land in log groups; query them with Logs Insights.
- Alarms — trigger on a threshold (e.g. CPU > 80% for 5 min) to notify via SNS or auto-scale.
- Dashboards — one pane across services.
CloudTrail — the audit log
CloudTrail records every API call in the account — who assumed which role, what they created or deleted, from which IP. It's your forensic trail for security and "who turned this off?" questions. Enable an organization trail so it covers every account.
First place to look in an incident
Start in the CloudWatch Alarms that fired, pivot to the relevant log group with Logs Insights to find the error, then check CloudTrail if you suspect a configuration or permission change caused it. Add X-Ray for distributed tracing once you have microservices.
10Your first deploy (hands-on)
Let's ship a static website on S3 + CloudFront using the aws CLI — cheap, safe, and a real, globally-cached site. Replace every CAPS placeholder.
0. Prerequisites
aws --version # install the AWS CLI v2 if missing aws configure sso # or: aws configure (for a key-based profile) aws sts get-caller-identity # verify you're authenticated
1. Create a bucket and upload a page
REGION=us-east-1 BUCKET=MY-UNIQUE-BUCKET-NAME # must be globally unique aws s3 mb s3://$BUCKET --region $REGION echo '<h1>Hello from AWS</h1>' > index.html aws s3 cp index.html s3://$BUCKET/index.html
Verify: aws s3 ls s3://$BUCKET lists index.html.
2. Put CloudFront in front (keep the bucket private)
Serve the bucket through a CloudFront distribution rather than making the bucket public. The simplest path:
aws cloudfront create-distribution \ --origin-domain-name $BUCKET.s3.$REGION.amazonaws.com \ --default-root-object index.html
This returns a distribution Id and a DomainName like dXXXX.cloudfront.net. In the Console, attach an Origin Access Control (OAC) to the distribution and apply the generated bucket policy so only CloudFront can read the bucket — that keeps Block Public Access on.
Verify: wait for Status: Deployed, then
aws cloudfront get-distribution --id DISTRIBUTION_ID \ --query 'Distribution.Status' curl -s https://dXXXX.cloudfront.net | head
You should see your Hello from AWS HTML.
3. Tear it down (do this to avoid charges)
aws cloudfront delete-distribution --id DISTRIBUTION_ID --if-match ETAG # disable first in Console, then delete aws s3 rm s3://$BUCKET --recursive aws s3 rb s3://$BUCKET
Verify nothing lingers: aws s3 ls | grep $BUCKET returns empty, and the distribution no longer appears in aws cloudfront list-distributions. Deleting these leaves you at $0.
*(Prefer a server? The EC2 equivalent is: aws ec2 run-instances with a t3.micro, a security group allowing port 80, SSH in and start a web server, curl the public IP, then aws ec2 terminate-instances — but S3 + CloudFront is cheaper and has nothing to patch.)*
11Where to go next
You now have the map. To go from reading to doing:
- AWS CLI cheat sheet — the terse companion to this guide: the exact
awscommands for S3, EC2, IAM, and VPC you'll run daily. Keep it open in a second tab. - AWS SRE sheet — once something is live, this covers operating it: CloudWatch alarms, incident triage, auto-scaling, and backup/restore drills.
- Cloud landing zones — when you outgrow one account, this walks through Organizations, OUs, SCPs, and Control Tower to set up multi-account AWS the right way.
Good habits to carry forward: turn on MFA and a budget before anything else, prefer roles over access keys, keep buckets private, spread across AZs, tag everything, and manage real infrastructure as code rather than by clicking. Everything else is just more services following the same four ideas.