AWS
What experienced AWS developers and DevOps engineers forget before an interview, grouped by subtopic; facts follow the AWS documentation. For PostgreSQL and Redis internals see postgresql.md and redis.md; for delivery semantics and retries see distributed.md; for deployment patterns and Terraform see devops.md.
Identity and access
Policy evaluation
Workload credentials
Cross-account access
- Within one account, an allow in the identity policy or the resource policy suffices (KMS key policies and role trust policies are exceptions).
- Across accounts, both sides must allow: the resource policy trusts the other account or principal, and that principal's identity policy grants the action.
- Third parties assume your role with an
sts:ExternalId condition, preventing the confused-deputy problem.
aws:PrincipalOrgID in a resource policy limits access to accounts in your organization.
KMS and envelope encryption
Networking
Public and private subnets
- A subnet is public when its route table points internet-bound traffic to an internet gateway; an EC2 instance also needs a public address and permissive rules to receive internet traffic.
- A NAT gateway in a public subnet lets private-subnet instances initiate IPv4 internet connections; the private subnet routes outbound traffic to it.
Network filters and endpoints
ALB vs NLB
|
ALB |
NLB |
| Layer |
L7: HTTP(S), gRPC, WebSockets |
L4: TCP, UDP, TLS, QUIC |
| Routing |
host, path, header, query string |
port; listener rules route by source IP version (since September 2026) |
| Addresses |
changing IPs; use the DNS name |
static IP per AZ (Elastic IPs optional) |
| Client IP |
in X-Forwarded-For |
preserved, or sent via PROXY protocol v2 |
| Extras |
OIDC/Cognito auth, WAF, Lambda targets |
TLS passthrough, PrivateLink services, very high throughput |
| Cross-zone |
on by default |
off by default; cross-AZ data is charged when on |
Gateway Load Balancer inserts inline appliances such as third-party firewalls.
Connecting VPCs
| Option |
Topology |
Note |
| VPC peering |
one-to-one |
not transitive, CIDRs can't overlap, no per-GB fee within an AZ |
| Transit Gateway |
hub and spoke |
transitive routing across many VPCs and on-prem; per-attachment and per-GB fees |
| PrivateLink |
one service, consumer → provider |
overlapping CIDRs fine; exposes one endpoint, not a network |
Route 53 routing
- Policies: simple, weighted (canary), latency, failover (with health checks), geolocation, geoproximity, multivalue.
- Alias records work at the zone apex (
example.com → ALB/CloudFront), where a CNAME isn't allowed; queries are free when the target is an AWS resource, but billed when it is a plain record in the same zone.
Compute
Workload choice
| Service |
Use when |
You still manage |
| EC2 |
OS, runtime, or host control matters |
instances, patching, scaling |
| ECS on Fargate |
containers without managing nodes |
task definitions, services |
| EKS |
Kubernetes APIs and ecosystem are required |
workloads; nodes unless Auto Mode or Fargate |
| Lambda |
event-driven, bounded work |
concurrency, timeouts, event handling |
Lambda limits and concurrency
Lambda cold starts and scaling
- A cold start downloads code, starts the runtime, and runs init code; the INIT phase is billed since August 2025.
- Reduce it with provisioned concurrency or SnapStart (Java, Python, .NET), which restores a snapshot of an initialized environment — make sure randomness and connections are recreated after restore.
- Default 1,000 concurrent executions per account per Region; each function scales by up to 1,000 more every 10 seconds.
API Gateway vs ALB
Storage and databases
S3 consistency and versions
- S3 has strong read-after-write consistency for object PUT and DELETE, including list results; a successfully written object is immediately readable.
- With versioning, deleting an object without a version ID adds a delete marker; deleting a specific version permanently removes it. Lifecycle rules can expire noncurrent versions.
- A presigned URL grants temporary access using the signer's permissions and expires no later than the credentials used to sign it.
S3 access and CloudFront
- Each prefix supports about 3,500 writes and 5,500 reads per second; spread hot keys over prefixes.
- Classes trade storage price against retrieval cost and latency: Standard → Standard-IA → Glacier Instant/Flexible/Deep Archive; Intelligent-Tiering moves objects automatically.
Block and shared files
- EBS is block storage attached to EC2 instances in the same Availability Zone; Multi-Attach works only for eligible volumes and instances and requires a clustered filesystem for simultaneous writes.
- EFS is shared file storage mountable by instances across Availability Zones in one Region.
Managed database behavior
Aurora storage
- The storage volume keeps 6 copies across 3 AZs; a write needs 4 of 6, so writes survive losing an AZ; the 3-of-6 read quorum survives an AZ plus one more copy.
- Normal reads go to one storage node known to be current; quorum reads are only needed during recovery.
- Up to 15 replicas share the same storage volume, so replica lag is usually well under 100 ms and failover doesn't copy data.
DynamoDB partitions and indexes
- Each partition serves about 3,000 RCU and 1,000 WCU and holds ~10 GB; a hot partition key throttles even if table capacity is fine.
- GSIs have their own capacity and are eventually consistent; a throttled GSI throttles writes to the base table. LSIs must be defined at table creation.
- Items are at most 400 KB (quotas); transactions cover up to 100 items; TTL deletes are background work that can lag by days.
Events and workflows
SQS delivery
- A received SQS message stays in the queue but is hidden for its visibility timeout; delete it after successful processing. Expiry or duplicate delivery can expose it again, so consumers still need idempotency.
- FIFO queues order messages within a message group. A repeated deduplication ID suppresses duplicate sends only within a 5-minute window; it is not permanent business-level deduplication.
Lambda with SQS
Routing and orchestration
- SNS pushes to subscribers; EventBridge matches event patterns and routes to targets, with optional archive/replay; SQS retains work for consumers to poll.
- Step Functions Standard workflows use exactly-once execution unless a task has explicit retries; asynchronous Express is at-least-once, while synchronous Express is at-most-once. Retried external side effects still need idempotency.
Operations
Observability and audit
- CloudWatch holds metrics, logs, and alarms; CloudTrail records account API activity. CloudTrail data events such as S3 object access are not logged by default when creating a trail.
- VPC Flow Logs record accepted/rejected IP traffic metadata, not packet payloads — for debugging routes and security rules.
Infrastructure changes and secrets
- CloudFormation change sets preview resource replacements or deletions before execution. Standard change sets compare templates; drift-aware change sets also compare actual resource state.
- Secrets Manager can rotate a secret in both its store and the backing service; use runtime retrieval or refresh so an application picks up the new value.
Capacity and cost guardrails
- Service quotas are per account and Region and often stop scaling before the application does — many are soft and raised by request.
- EC2 Spot capacity can be reclaimed; stop/terminate interruption notices give about 2 minutes on a best-effort basis (hibernation starts immediately). Checkpoint work and replace capacity proactively.
Cost drivers
- NAT gateway data processing (~$0.045/GB in us-east-1, plus hourly) is a classic surprise; S3 and DynamoDB gateway endpoints are free and skip it.
- Cross-AZ traffic costs ~$0.01/GB in each direction, so chatty services and replicas spread across AZs add up.
- Internet egress and CloudWatch Logs ingestion (~$0.50/GB) are the other usual suspects.
- Discounts: Savings Plans and Reserved Instances (up to ~72% for 1–3 year commitments), Spot (up to ~90%), Graviton (roughly 20% cheaper per hour than comparable x86).