skip to content

AWS CloudTrail data events are off by default. Explain how they differ from management events, why switching them on account-wide can dominate the CloudTrail bill, and how you would scope them.

level: middleimportance: must knowfreq 62%

answer

  1. control plane versus data plane
  2. volume follows application traffic
  3. first copy free, per-event after that
  4. reads usually dwarf writes
  5. match on ARN prefix and readOnly

basics

~20 s

Management events are control-plane calls and their first copy per trail is free; data events are data-plane calls such as S3 object reads and Lambda invocations, billed per event with no free allowance. Volume is why they dominate the bill, so scope them with event selectors.

solid answer

~40 s

Management events record control-plane activity — `RunInstances`, `CreateBucket`, `AttachRolePolicy` — and there are relatively few of them, which is why the first copy delivered per trail is free. Data events record the data plane: every `GetObject`, every Lambda invocation, every DynamoDB item call. On a busy bucket that is millions of events a day, and they are billed per event delivered with no free tier, plus the S3 storage and any CloudWatch Logs ingestion downstream. So the fix is never "log everything and filter later" — it is to decide, per resource, what is worth recording. Advanced event selectors let you match on `eventCategory`, `resources.type`, `resources.ARN` and `readOnly`, so you can log write-only activity on one bucket prefix and skip the read traffic that makes up the bulk of the volume.

code

bash · 9 lines
bash
aws cloudtrail put-event-selectors --trail-name my-trail \
  --advanced-event-selectors '[{
    "Name": "Write-only S3 object activity on one prefix",
    "FieldSelectors": [
      {"Field": "eventCategory", "Equals": ["Data"]},
      {"Field": "resources.type", "Equals": ["AWS::S3::Object"]},
      {"Field": "readOnly", "Equals": ["false"]},
      {"Field": "resources.ARN", "StartsWith": ["arn:aws:s3:::my-bucket/ingest/"]}
    ]}]'

go deeper

for a junior

Know the two categories by example: control-plane calls like RunInstances are management events, object-level S3 reads and Lambda invocations are data events, and the second group is off by default.

for a middle

Explain the volume and billing asymmetry and show a concrete scope — an advanced event selector matching on eventCategory, resources.ARN and readOnly rather than a whole-account switch.

for a senior

Demonstrate that you would verify the driver in Cost Explorer by usage type before changing anything, and that you would look for duplicate trails recording the same stream twice.

for a principal

Own the policy for the estate: management events everywhere as a non-negotiable baseline, data events justified per workload, and a review that catches teams adding overlapping trails.

## Two categories, two orders of magnitude CloudTrail splits API activity into categories, and the split matters mostly because of volume. **Management events** are control-plane operations: creating, modifying, describing and deleting resources, plus sign-in and role-assumption activity. `ec2:RunInstances`, `s3:CreateBucket`, `iam:AttachRolePolicy`, `sts:AssumeRole`. Even a large estate produces a modest number of these per day, because they correspond to humans and pipelines changing infrastructure. **Data events** are data-plane operations against the contents of a resource: `s3:GetObject`, `s3:PutObject` and `s3:DeleteObject` on individual objects, `lambda:Invoke` on a function, item-level calls on a DynamoDB table. These correspond to *application traffic*. One moderately busy S3 bucket serving assets can generate more data events in an hour than the whole account generates management events in a month. **Insights events** are a third category: CloudTrail analyses management call volume and error rates and emits an event when the pattern deviates from the recent baseline. They are enabled separately and billed on the events analysed. ## Why the bill explodes The pricing shape follows the volume shape. As of 2025 the first copy of management events delivered per trail is free, and additional copies of the same management events are billed. Data events have no free allowance at all: you pay per event delivered, and then again for what those events cost downstream — S3 storage for the gzipped objects, CloudWatch Logs ingestion if you forward the trail there, ingestion charges if you feed them into CloudTrail Lake, and scanned bytes when something later queries them. That compounding is what turns a checkbox into a budget item. A team enables "all S3 data events" on all buckets during a security review, forwards the trail to CloudWatch Logs so alarms can be written on it, and discovers the following month that the CloudTrail and CloudWatch lines together are a material fraction of the account bill — driven almost entirely by read traffic nobody ever queries. ## Scoping is the whole skill CloudTrail gives you two generations of selector. **Basic event selectors** let you choose the read/write type (`ReadOnly`, `WriteOnly`, `All`) and list data resources by type and ARN, including S3 prefixes. **Advanced event selectors** are the richer form and are what you should reach for: they match on fields including `eventCategory`, `resources.type`, `resources.ARN`, `eventName`, `eventSource` and `readOnly`, with operators such as `Equals`, `NotEquals`, `StartsWith` and `NotStartsWith`. ```bash aws cloudtrail put-event-selectors --trail-name my-trail \ --advanced-event-selectors '[{ "Name": "Write-only object activity on one prefix", "FieldSelectors": [ {"Field": "eventCategory", "Equals": ["Data"]}, {"Field": "resources.type", "Equals": ["AWS::S3::Object"]}, {"Field": "readOnly", "Equals": ["false"]}, {"Field": "resources.ARN", "StartsWith": ["arn:aws:s3:::my-bucket/ingest/"]} ]}]' ``` The reasoning behind a scope like that is worth saying out loud in an interview: 1. **Reads usually outnumber writes by orders of magnitude**, and writes are the ones that change state. Filtering on `readOnly` false is often a 90%-plus volume cut on its own. 2. **Not every bucket deserves data events.** The bucket holding customer documents may; the bucket holding a public web front-end's static assets almost certainly does not. 3. **Prefixes narrow it further.** If only one path in a bucket is sensitive, match on the ARN prefix rather than the whole bucket. 4. **A second trail duplicating the same events doubles the bill.** If two teams each create a trail logging the same data events, you pay twice for one stream of activity. ## The trap of the opposite mistake The reflex after a cost review is to turn things off, and the wrong thing to turn off is management events. They are the cheap category — the first copy per trail is free — and they are the record you cannot reconstruct after the fact. The economically sound posture is management events everywhere as a baseline, and data events as a deliberate, narrow, per-resource decision that someone has justified. ## Verifying rather than guessing Don't assume which selector is driving the spend. CloudTrail usage appears in Cost Explorer split by usage type, so you can see whether the money is going to data events, extra management-event copies, or Insights. Pair that with the S3 storage growth on the trail bucket and the CloudWatch Logs ingestion figure, because the CloudTrail line item alone understates the true cost of a broad selector.

  • Someone proposes cutting CloudTrail costs by disabling management events on the account's only trail. What do you say?
    That it saves almost nothing and costs a lot. The first copy of management events per trail is free, so the saving is the S3 storage on a small volume of objects. What you lose is the only durable record of control-plane changes beyond the 90-day Event history window, and it is unrecoverable after the fact. The money is in data events; cut there instead.
  • Your CloudTrail spend jumped and you have several trails. How do you find which selector is responsible?
    Break CloudTrail down by usage type in Cost Explorer — data events, additional management-event copies and Insights bill as separate usage types, which points at the category immediately. Then map that back to the trails: list each trail's event selectors and look for two trails recording the same events, or a data-event selector that matches a whole bucket instead of a prefix.
  • Do data events show up in EventBridge the same way management events do?
    Not automatically. Management events reach the default event bus as `AWS API Call via CloudTrail` without a trail. For object-level S3 activity to arrive that way you need a trail logging those data events — or, more commonly today, you enable S3's own EventBridge notifications, which are a separate feature and are not billed as CloudTrail data events.

saying these in an interview costs you the question

  • Says all CloudTrail events cost the same per event
  • Enables all data events on all buckets by default
  • Confuses Insights events with data events
  • Forgets S3 storage and Logs ingestion downstream costs
  • Cuts management events to save money

context