Lesson 24 of 30
CloudWatch answers 'is it broken?' CloudTrail answers 'who changed the thing that broke it, and when?' — the same account, a completely different question, and interviews expect you to know which tool answers which.
10 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
A team wants to know exactly which identity changed an S3 bucket's policy overnight. Which AWS service actually answers that, and why not the other?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
CloudTrail is AWS's audit log: an immutable record of every API call made against an account — who made it (which user or role), what action they took, when, from what source IP, and whether it succeeded. It exists independent of whether anything is currently healthy or broken; it's a historical record of activity, not a monitor of state.
That's the real distinction from this track's CloudWatch lesson. CloudWatch collects logs, metrics, and alarms about running systems to answer "is this within normal range right now?" CloudTrail records account-level activity to answer "who did this, and when?" A CloudWatch alarm can tell you error rates spiked at 2am; only CloudTrail can tell you a bucket policy was changed at 1:58am, by which identity, from which IP.
Every recorded action falls into one of two categories:
GetObject, a Lambda invocation. Far higher volume, and not logged by default — enabling them is an explicit, opt-in decision because of the cost and volume involved.A production S3 bucket's access policy changed overnight and the app started throwing 403s. CloudWatch's error-rate alarm fired and named the affected service — but not who touched the bucket. CloudTrail's Event history is where that answer lives: filtering for PutBucketPolicy events against that specific bucket name returns an event record naming the exact IAM identity (a user or an assumed role's ARN), the source IP, the timestamp, and the request parameters — including the old and new policy document.
{
"eventName": "PutBucketPolicy",
"eventTime": "2026-08-12T20:58:03Z",
"userIdentity": { "arn": "arn:aws:iam::123456789012:role/ci-deploy" },
"sourceIPAddress": "203.0.113.42",
"requestParameters": { "bucketName": "user-uploads" }
}
That single event turns "something changed" into "this exact identity changed this exact setting at this exact time" — the difference between guessing and knowing.
AccessDenied event isn't noise to filter out — repeated failed attempts at an action an identity doesn't have permission for is exactly the kind of pattern that indicates a misconfigured pipeline or a compromised credential probing for what it can reach."How would you find out who deleted this resource, and when?" is a real, common question, and naming CloudTrail specifically — not CloudWatch, not vaguely "the logs" — while explaining the management-vs-data-event distinction is what separates someone who's actually used AWS's audit tooling from someone reasoning about monitoring in the abstract.