Skip to main content
CloudTrail data events record object-level and function-level activity, such as every S3 GetObject or Lambda Invoke, and each event is billed. In development and test accounts this logging is rarely needed but can generate millions of events a day. nOps finds non-production accounts that pay for data events and shows what turning them off would save.

Why it matters

Data events are often enabled for every bucket and function by an organization-wide template, so busy non-production accounts pay for audit detail nobody reviews.

How nOps finds it

nOps reads the last 7 complete days of CloudTrail data-event charges for each account. An account is flagged when at least 90% of that cost belongs to non-production, judged by the environment tag, then the nOps environment, then the account name. Accounts whose names suggest security, audit, logging, compliance, management, organization or payer use are skipped. The saving is the full data-event cost, scaled to a month, and must be at least $20 a month. Narrowing the events instead of turning them off saves part of that.

Before you start

Permission to update trails (cloudtrail:PutEventSelectors) in the account, or in the management account for an organization trail. Confirm with your security team that data events are not required in this account.

How to implement

  1. Find the trails that record data events for the account: aws cloudtrail get-event-selectors --trail-name TRAIL for each trail listed by aws cloudtrail describe-trails. Check organization trails in the management account too.
  2. Confirm no audit, compliance or incident-response process depends on data events from this account.
  3. In the CloudTrail console, open the trail, edit Data events, and remove them, or limit them with advanced event selectors (for example write-only events, or only the buckets and functions that matter).
  4. If the trail is managed by CloudFormation, Terraform or AWS Control Tower, change it there so it is not re-enabled.

Risks and considerations

  • Without data events you lose the record of who read or wrote individual objects and invoked functions in this account.
  • If the events come from an organization trail, changing it affects every account it covers. Use advanced event selectors to exclude this account instead.
  • To roll back, add the data-event selectors back to the trail. Events from the time they were off are not recorded.

FAQs

Billing reports data events per account, not per trail, so nOps cannot tell which trail recorded them. Check every trail that covers the account.
From the environment tag on the charges, then the environment nOps assigned, then the account name. At least 90% of the data-event cost must be non-production.