E ExamMaster

AWS Cloud Architect & Developer · AWS Cloud Architecture

EC2, S3 Storage and IAM Security

Core AWS compute with EC2, object storage with S3, and identity and access management with IAM.

Eight concepts on the three services that back most Solutions Architect Associate questions: EC2 as compute, S3 as durable object storage, and IAM as the identity layer that ties them together securely.

  • AWS Cloud Architect & Developer
  • Medium level
  • 8 concepts
  • 5 practice questions

1EC2 instance families

An EC2 instance is a resizable virtual server. AWS groups instance types into families whose letter codes map to a workload shape: T for burstable general use, M for balanced general purpose, C for compute-optimised, R and X for memory-optimised, and I or D for storage-optimised. The exam choice is driven by the vCPU-to-memory ratio the workload actually needs, not by a brand name on the instance.

Figure. Family letter encodes the bottleneck: compute, memory, storage, or balanced general purpose.

How to pick a family

  1. Name the bottleneckIs the job CPU-bound, memory-bound, disk-bound, or mostly idle with occasional spikes?
  2. Match the letterC for heavy compute, R/X for large in-memory working sets, I/D for high local I/O, T when the load is spiky and average utilisation is low.
  3. Ignore the marketing nameAn in-memory database wants a memory-optimised family even if a cheaper burstable type could boot the OS.
Family letter to workload
FamilyOptimised forTypical exam cue
TBurstable CPU creditsDev, test, low and spiky average load
MBalanced vCPU and memoryGeneral application servers
CHigh vCPU relative to memoryBatch compute, media encoding, HPC-ish jobs
R / XHigh memory relative to vCPUIn-memory databases, large caches
I / DLocal NVMe or dense HDDData warehouses, high sequential I/O
A workload runs a large in-memory database and is limited by RAM, not by CPU. Which EC2 family is the best first pick?
  1. C (compute-optimised)
  2. R or X (memory-optimised)
  3. T (burstable)

An in-memory database needs a high memory-to-vCPU ratio, which is exactly what R/X families provide. C is the opposite ratio, and T is for spiky low average load rather than a steady RAM-heavy working set.

2On-Demand, Reserved and Spot

How you pay for an EC2 instance is a separate choice from which family you run. On-Demand is the flexible default: start and stop at any time, pay by the second with no commitment. Standard Reserved Instances and Savings Plans trade a 1- or 3-year commitment for up to about 72% off On-Demand for steady baseline load. Spot Instances bid on spare capacity and can save up to about 90%, but AWS can reclaim the instance with short notice — so they fit only interruptible work such as batch jobs and CI.

Figure. On-Demand flexibility, commitment discounts, Spot interruption risk — pick by interrupt tolerance and steady load.

How the exam sorts purchase options

  1. Can it die mid-run?If interruption is unacceptable, Spot is out — stay on On-Demand or a commitment discount.
  2. Is the load steady for years?A 24/7 baseline that will still be there in a year earns Reserved Instances or Savings Plans.
  3. Is cost the dominant constraint?Unpredictable, killable, cost-sensitive work — batch, CI, render farms — is the Spot cue.
Purchase option vs workload shape
OptionCommitmentInterruptionExam cue
On-DemandNoneNone from AWSFlexible, unknown or changing load
Reserved / Savings Plans1 or 3 yearsNone from AWSSteady 24/7 baseline; up to ~72% off
SpotNoneCan be reclaimedBatch/CI; up to ~90% off; must tolerate kill
A CI fleet runs short jobs that can restart safely, and cost is the main constraint. Which purchase option fits?
  1. Standard Reserved Instances for three years
  2. Spot Instances
  3. On-Demand only, because Spot cannot run compute

CI is interruptible and cost-sensitive — the Spot cue. Reserved Instances lock in a commitment that CI fleets rarely need, and Spot absolutely can run compute; the catch is reclaim, not capability.

3S3 as object storage

S3 is object storage, not a file system and not a block disk. You put objects into buckets; each object is addressed by a key. S3 Standard advertises 99.999999999% (eleven nines) durability and a 99.99% availability SLA, because objects are stored redundantly across multiple facilities. New buckets are private by default, and Block Public Access settings can override a permissive bucket policy — so "I added a public-read policy" is not enough if public access is still blocked. S3 now provides strong read-after-write consistency for PUT, GET, LIST and DELETE on all objects in all buckets.

Figure. S3 is object storage: bucket + key address opaque bytes with metadata — not a POSIX disk.

How S3 access actually opens

  1. Private by defaultA new bucket denies public reads until you deliberately change identity or resource policies.
  2. Policy alone may failBlock Public Access is an account/bucket safety net that can still deny even when a bucket policy allows.
  3. Consistency is strongAfter a successful write, subsequent reads and listings see that write — you do not plan around eventual consistency for ordinary GET/PUT/LIST/DELETE.
A team adds a bucket policy allowing public s3:GetObject, but anonymous GETs still return Access Denied. What is the most likely cause?
  1. S3 only supports eventual consistency for new objects
  2. Block Public Access is still enabled and overrides the policy
  3. Public reads require an EC2 instance in front of the bucket

Block Public Access is designed to override permissive public policies as a safety net. Strong consistency is already the default for these operations, and EC2 is not required for public object reads.

4S3 storage classes and lifecycle

Storage classes trade cost against how often you read an object and how long retrieval may take. S3 Standard suits frequent access. S3 Standard-IA and One Zone-IA suit infrequent access with immediate retrieval, and they carry a 30-day minimum storage charge. Glacier Instant Retrieval, Glacier Flexible Retrieval and Glacier Deep Archive cover colder archives, with retrieval latency ranging from milliseconds to up to about twelve hours. Lifecycle rules transition objects one way toward colder tiers as access drops — you design the path when you create the rule, not by hoping objects warm themselves back to Standard.

Figure. Cheaper classes trade retrieval time and fees — match access frequency, not just $/GB.

How a cost-optimal log path is built

  1. Hot windowKeep frequently read logs in S3 Standard for the first stretch of heavy access.
  2. Warm, instantWhen reads become rare but must still be immediate, transition to Standard-IA (respecting the 30-day minimum).
  3. Cold archiveWhen hours of retrieval are acceptable for compliance retention, transition to Glacier Flexible Retrieval, then expire at the retention limit.
Storage class by access pattern
ClassAccess patternRetrievalExam trap
S3 StandardFrequentMillisecondsDefault hot tier
Standard-IA / One Zone-IAInfrequentMilliseconds30-day minimum; IA beats Glacier when reads must be instant
Glacier Instant RetrievalArchive, rareMillisecondsArchive cost with instant get
Glacier Flexible RetrievalArchive, rareMinutes to hoursCompliance retain; hours OK
Glacier Deep ArchiveLong-term archiveUp to ~12 hoursCheapest; slowest restore
Logs must be kept seven years, are almost never read, and may take hours to restore when an auditor asks. Which class fits the cold tier?
  1. S3 Standard
  2. S3 Standard-IA
  3. S3 Glacier Flexible Retrieval

Rare access plus hours-acceptable retrieval is the Glacier Flexible Retrieval cue. Standard wastes money on cold data, and Standard-IA is for infrequent but still immediate gets.

5Object size and request-rate limits

A single S3 object can be up to 5 TB, but one PUT operation is capped at 5 GB — above roughly 100 MB you are expected to use multipart upload, and above 5 GB you must. Per partitioned prefix, S3 supports at least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second. High request-rate designs spread keys across prefixes rather than hammering one hot key prefix.

Scalar service ceilings: single PUT object up to 5 TB (multipart), 3500 PUT/COPY/POST/DELETE and 5500 GET/HEAD per prefix per second as a performance guide. Bars inventing a continuous scale would fake a lesson the exam treats as memorised limits.

Hard numbers the exam quotes
LimitValueWhat you do about it
Max object size5 TBSplit logical datasets across objects if larger
Max single PUT5 GBUse multipart upload (recommended above ~100 MB)
Writes per prefix≥ 3,500 / sPartition key prefixes under heavy ingest
Reads per prefix≥ 5,500 GET/HEAD / sSame prefix-spreading idea for hot reads
You must store a 20 GB file in S3 as one object. What is required?
  1. A single PUT of the whole file
  2. Multipart upload, because a single PUT cannot exceed 5 GB
  3. Split into four objects, because no object may exceed 5 GB

Objects may be up to 5 TB, so 20 GB as one object is fine — but each individual PUT tops out at 5 GB, so multipart upload is required. Splitting into multiple objects is optional design, not a hard size rule at 5 GB.

6IAM users, groups, roles and policies

IAM answers who can do what in an account. Users are long-lived identities for people (or occasionally applications that still use access keys). Groups bundle users so you attach policies once. Roles are identities meant to be assumed: they hand out temporary credentials from STS and are what EC2, Lambda and federated users should use. Policies are JSON documents that Allow or Deny actions on resources. The standing design rule is least privilege — grant only the actions and resources the task needs, never AdministratorAccess because it is convenient.

Figure. Identities (user/group/role) receive permissions only through policies — roles are assumed, not long-lived passwords.

How the four pieces fit

  1. IdentityPick a user for a person with long-lived sign-in, or a role for anything that should only ever hold temporary credentials.
  2. BundlePut users in groups and attach shared policies to the group rather than copying the same policy onto each user.
  3. AuthoriseWrite a policy that names the actions and the resource ARNs; attach it to the user, group or role that needs them.
An application running on EC2 needs AWS credentials that rotate automatically. Which IAM element should it use?
  1. An IAM user access key baked into the AMI
  2. An IAM role assumed via the instance profile
  3. An IAM group with AdministratorAccess

Roles exist to issue temporary STS credentials to services. Baking user keys into an AMI creates long-lived secrets that do not rotate cleanly, and a group is only a bundle of users — it is not what an EC2 instance assumes.

7IAM policy evaluation

Access is denied by default. An explicit Allow in an applicable identity-based or resource-based policy is what opens a path, and the effective permissions are the union of those policies — but any explicit Deny wins over every Allow. When a question shows both an Allow and a Deny that match the same action and resource, the answer is denied; options that claim the Allow still grants access are traps.

Figure. Explicit Deny wins; otherwise an Allow must appear or the default is Deny.

How a request is decided

  1. Start at denyIf nothing Allow-matches the action and resource, the request is denied.
  2. Collect AllowsIdentity-based and resource-based Allows combine — either source can grant.
  3. Apply Deny lastA single matching explicit Deny cancels every Allow for that request.
Evaluation outcomes
What matchesResultExam reading
No Allow, no DenyDeny (implicit)Default closed
Allow onlyAllowPath is open
Allow and DenyDeny (explicit)Deny always wins
Deny onlyDenySame end state as default
A role policy Allows s3:GetObject on a bucket, and a bucket policy Denies s3:GetObject for that same role. What happens on GetObject?
  1. Allowed, because identity policies override resource policies
  2. Denied, because an explicit Deny overrides any Allow
  3. Allowed, because the union of policies includes an Allow

Explicit Deny always wins, whichever policy document carried it. The union rule applies to Allows, not to a fight between Allow and Deny.

8EC2 access to S3 via a role

When an application on EC2 must read an S3 bucket, the exam-correct pattern is never to embed access keys on the instance. Create an IAM role whose policy allows only the needed actions — typically s3:GetObject on that bucket ARN — attach the role to the instance through an instance profile, and let the SDK fetch temporary credentials from the instance metadata service. Scope the resource ARN to the exact bucket or prefix; a wildcard "*" fails least privilege even when the call would work.

Figure. The instance never holds long-lived keys. It assumes a role; the role is what S3 authorises for GetObject on the scoped bucket ARN.

How the secure path works

  1. Role and policyCreate a role trusted by ec2.amazonaws.com with a policy that Allows only the required S3 actions on the specific bucket ARN.
  2. Instance profileAttach that role to the EC2 instance so the instance identity is the role.
  3. Temporary credentialsThe SDK reads rotating credentials from the instance metadata service — no long-lived keys on disk.

Least-privilege GetObject policy

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::logs-bucket/*"
  }]
}
An app on EC2 needs read-only access to one S3 bucket. What is the most secure grant?
  1. Create an IAM user, put its access keys in environment variables on the instance
  2. Attach an IAM role with s3:GetObject on that bucket ARN via an instance profile
  3. Make the bucket public for s3:GetObject so the instance needs no credentials

A role attached through an instance profile issues temporary credentials scoped to the bucket. Long-lived user keys on the instance are the standing anti-pattern, and opening the bucket publicly abandons least privilege entirely.

Notes

  • EC2 Instance Types: Families map to workloads such as T (burstable), M (general), C (compute-optimized), R/X (memory-optimized), and I/D (storage-optimized); choose based on the vCPU-to-memory ratio the workload needs.
  • S3 Storage Classes: S3 Standard for frequent access, S3 Standard-IA and One Zone-IA for infrequent access with a 30-day minimum, and S3 Glacier Instant/Flexible/Deep Archive for archival with retrieval latency from milliseconds to 12 hours.
  • IAM Policy Evaluation: Access is denied by default; an explicit Allow grants access, but any explicit Deny always overrides an Allow, and permissions come from the union of identity-based and resource-based policies.
  • S3 Data Consistency: S3 provides strong read-after-write consistency for all PUT, GET, LIST, and DELETE operations on objects across all buckets automatically.
  • IAM Roles vs Users: Roles provide temporary credentials via STS and are assumed by EC2, Lambda, or federated users, avoiding long-lived access keys that IAM users carry.

Formulas

  • S3 object size limit: single object up to 5 TB, but a single PUT is capped at 5 GB (use multipart upload above 100 MB).
  • S3 durability and availability: 99.999999999% (11 nines) durability and 99.99% availability SLA for S3 Standard.
  • EC2 On-Demand vs Reserved vs Spot: Spot can save up to 90% off On-Demand; Standard Reserved Instances save up to 72% for a 1 or 3 year commitment.
  • IAM limits: up to 5000 IAM users per account and a maximum of 10 managed policies attachable per IAM identity.
  • S3 request rate: at least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per partitioned prefix.

Exam traps & shortcuts

  • When a question needs unpredictable, interruptible, cost-sensitive compute (batch/CI), pick Spot Instances; for steady 24/7 baseline load, pick Reserved or Savings Plans.
  • If a policy scenario has both an Allow and a Deny, the answer is Deny wins - eliminate any option claiming access is granted.
  • Use S3 Lifecycle rules to transition objects to IA/Glacier automatically; if the question stresses cost for rarely accessed but instantly needed data, choose S3 Standard-IA over Glacier.
  • Never embed access keys on an EC2 instance; the exam-correct answer is to attach an IAM role to the instance.

Reference tables

The three services this topic keeps separate — compute, object storage, identity.

Service cheat sheet
ServiceWhat it isStanding exam fact
EC2Resizable virtual serversPick family by bottleneck; pick purchase option by interruptibility and steadiness
S3Object storage in bucketsPrivate by default; eleven-nines durability; strong consistency for ordinary object ops
IAMUsers, groups, roles, policiesLeast privilege; Deny wins; roles for services, not long-lived keys on EC2

Phrases that usually decide the option under time pressure.

Keyword → answer
Cue in the stemReach for
In-memory database / high RAMR or X instance family
Batch or CI, cost-sensitive, can restartSpot Instances
Steady 24/7 for 1–3 yearsReserved Instances or Savings Plans
Rare access, need immediate getS3 Standard-IA
Archive, hours OK to restoreGlacier Flexible Retrieval
Avoid credentials on the serverIAM role on the instance
Allow and Deny both matchDenied — Deny wins

Recap

Read this the night before the SAA compute/storage/IAM block.

EC2 family
Letter codes track the bottleneck — C for CPU, R/X for RAM, I/D for local disk, T for burstable spiky load.
Purchase option
Spot only when the job can die; Reserved/Savings Plans for steady multi-year baseline; On-Demand when you need flexibility.
S3 model
Object storage, private by default, eleven nines, strong consistency. Block Public Access can still deny a public policy.
Storage class
Standard → IA when rare but instant → Glacier when hours are fine. Lifecycle only cools; it does not warm back.
Size limits
Object up to 5 TB; single PUT max 5 GB, so multipart above that (and in practice above ~100 MB).
IAM evaluation
Default deny; Allows union; any explicit Deny overrides every Allow.
EC2 → S3
Attach a least-privilege role via an instance profile. Never bake access keys into the instance.

Practise EC2, S3 Storage and IAM Security

Reading is free and needs no account. Practice, mocks and progress live in the app.

  • 5 exam-style questions on this topic, with explanations
  • A 5-question practice set that ends the chapter
  • Timed mocks scored with the real marking scheme
  • Readiness tracked per topic, kept on your device
Continue with Google — freeNo card, no trial. Works offline once installed.