Home › AWS › AWS data services › CloudTrail
AWS data services · Observability, audit and cost · about 9 min read
AWS CloudTrail (and CloudTrail Lake)
The record of who called which AWS API, when and from where; here it joins the access report as audit evidence.
In plain words
What it is
Almost everything that happens in AWS happens through an API call. Creating a bucket, reading a file, using an encryption key, changing a permission and starting a DMS task are all API calls. CloudTrail records these calls as events. Each event says who made the call (the user or role), what they did, to which resource, when, from which IP address, and whether it worked. It is the black-box flight recorder of an AWS account.
CloudTrail has three kinds of event. Management events are changes and reads of configuration, such as creating a role or using a KMS key. Data events are operations on the data itself, such as reading or writing an S3 object or invoking a Lambda function; they are off by default because there are so many. Network activity events record calls that pass through VPC endpoints. The console's Event history keeps 90 days of management events for free. To keep more, or to keep data events, you create a trail, which delivers event files to an S3 bucket every few minutes.
A concrete example: a tyre maker keeps compound recipes in a restricted catalog with its own S3 bucket and KMS key. An auditor asks who read recipe data in the last quarter. The Databricks audit table shows which people queried the recipe tables. CloudTrail shows which IAM roles used the recipe KMS key and read objects in the recipe bucket. If CloudTrail shows a role reading that bucket that is not the Unity Catalog storage credential, someone has gone around the catalog, and that is the finding.
CloudTrail Lake was a managed store with SQL queries over events. AWS closed it to new customers on 31 May 2026 and recommends CloudWatch for new work. Plain trails, which are what this platform uses, are not affected.
The signed visitor book at a secure building's front desk, kept in a locked room in another building where the visitors cannot reach it.
Big picture
Where it fits
The lit lane is where CloudTrail works. Boxes on the left feed it; boxes on the right use what it produces.
CloudTrail sits in the band across the bottom of the picture, with health and cost. It is set up before anything else. In the landing zone, an organization trail sends every account's events to an S3 bucket in a separate log-archive account, with log file integrity validation turned on. People who run the data platform cannot change or delete those files.
On the reference platform, CloudTrail is one of three sources for the access report. Databricks audit system tables say which person or service principal read which table or column through Unity Catalog. CloudTrail S3 data events and KMS events say which IAM role touched which bucket and key. These are joined in prod_ops into ops.fct_access, one row per read of sensitive data. Data owners review it every quarter, and it is the evidence pack for an auditor.
The join works because of a rule in the platform design: only Unity Catalog's storage credentials and the platform's own service roles should ever touch the catalog buckets. Any other role in the CloudTrail data shows a path around governance. CloudTrail also feeds incident triage, because the triage step checks recent configuration and permission changes when a pipeline breaks.
How it works
The ideas you need
| Idea | What it means |
|---|---|
| Event | One recorded API call: who, what, which resource, when, from where, and the result. |
| Management event | A call that manages resources, such as creating a role or using a KMS key. Logged by default. |
| Data event | A call on data inside a resource, such as S3 GetObject or PutObject. Off by default; you choose which buckets to log. |
| Trail | A configuration that delivers events as compressed files to S3, and optionally to CloudWatch Logs, for as long as you keep them. |
| Organization trail | One trail, created in the management or delegated admin account, that records events for every account in AWS Organizations. |
| Event history | The free, 90-day view of management events in each account and Region. |
| Advanced event selectors | Filters that choose exactly which data events to log, for example only GetObject on the restricted buckets. |
| Log file integrity validation | Hourly signed digest files that prove trail files were not changed or deleted after delivery. |
| CloudTrail Insights | A feature that spots unusual rates of API calls or errors compared with a baseline. |
Choosing
When to use it, and when not
Use it when
- You need evidence of who changed permissions, keys, buckets or network settings, for an audit or an incident.
- You need proof of who read sensitive data at the storage level, alongside Databricks audit logs.
- You run a landing zone with many accounts and want one tamper-evident record in a log-archive account.
- You want to react within minutes to risky changes, such as a bucket policy made public, through EventBridge rules.
- A regulation asks you to keep access logs for years, with proof they were not altered.
Avoid it when
- You want to log S3 data events on every bucket, including landing and bronze, which multiplies cost for little audit value.
- You plan a new CloudTrail Lake setup; it is closed to new customers, so land trail files in S3 or use CloudWatch.
- You want to know which person queried which table through Databricks; that is in the Databricks audit system table, not CloudTrail.
- You need application-level logs, such as what a pipeline did; that belongs in the run log and CloudWatch Logs.
Production grade
What goes wrong in production
| Problem | What breaks | What to do |
|---|---|---|
| Data events cost | Logging every S3 read on busy buckets produces billions of events and a large bill. | Use advanced event selectors to log data events only on restricted and personal-data buckets, and only the operations you need. |
| Role, not person | CloudTrail shows the Unity Catalog storage credential's role reading a bucket, not the person behind the query. | Join CloudTrail with Databricks audit system tables on time and resource, and treat any other role touching the bucket as a finding. |
| Trail turned off or changed | An attacker or a well-meaning admin stops logging or changes the trail to hide activity. | Use an organization trail owned by the management account, deny StopLogging and DeleteTrail with SCPs, and alarm on those events. |
| Delivery delay | Events reach S3 a few minutes after the call, not instantly, so near-real-time rules see a lag. | Use EventBridge for fast reactions to management events, and use trail files in S3 for the complete record and reports. |
| Format drift and nested JSON | Event fields vary by service and are nested, so reports break when a new field appears. | Read trail files with Auto Loader into a bronze table with schema evolution, and build a small silver table with the fields the access report needs. |
| CloudTrail Lake closure | Teams that planned to query events with CloudTrail Lake find it closed to new customers. | Query trail files in Databricks or Athena, or move to CloudWatch as AWS recommends; existing Lake users can export to CloudWatch. |
Alternatives
What to compare it with
| Alternative | Pick the alternative when | Pick CloudTrail when |
|---|---|---|
| Databricks audit system tables | You need who read which table, column or volume through Unity Catalog, by person or service principal. | You need storage-level, key-level and AWS configuration events. |
| Amazon CloudWatch (CloudTrail ingestion) | You want AWS's recommended successor to CloudTrail Lake, with query, alerts and Iceberg access in one service. | You already land trail files in S3 and analyse them in Databricks. |
| Amazon Athena over trail files | You want quick ad hoc SQL over trail files in S3 without moving them. | You need the access report joined with Databricks audit, which is easier in Databricks. |
| Azure Activity Log and diagnostic logs | You are on Azure. | You are on AWS. |
| Google Cloud Audit Logs | You are on Google Cloud. | You are on AWS. |
Cost
How you pay
The 90-day event history is free. The first copy of management events delivered by a trail in each Region is free; extra copies are charged per 100,000 events. Data events and network activity events are charged per 100,000 events delivered. CloudTrail Insights is charged per event analysed. You also pay S3 storage for trail files and any CloudWatch Logs ingestion if you send events there. Check the CloudTrail pricing page for your region.
What drives the bill
- Volume of S3 data events on the buckets you choose to log.
- Extra trails that deliver second copies of management events.
- S3 storage for years of trail files in the log-archive account.
- CloudTrail Insights, if turned on for all event types.
Cost traps
- Logging data events on all S3 buckets, including the busy landing and bronze buckets.
- Two trails in the same Region both delivering management events, which charges the second copy.
- Sending every event to CloudWatch Logs as well as S3 doubles ingestion cost.
- No lifecycle rule on the trail bucket, so old files never move to cheaper storage classes.
Prices change; check the AWS pricing page for your region before deciding.
Security and governance
Keeping it safe
- Use one organization trail into a dedicated log-archive account; workload admins get no write or delete rights on that bucket.
- Turn on log file integrity validation, encrypt trail files with a KMS key in the log-archive account, and use S3 Object Lock where rules require it.
- Protect the trail with SCPs that deny StopLogging, DeleteTrail and UpdateTrail outside the security team.
- Send key management events to EventBridge and alert on risky changes, such as a KMS key scheduled for deletion or a bucket policy that allows public access.
- Trail files contain IP addresses and user names, which can be personal data; restrict who can read them and set a retention period that matches policy.
- Use a VPC endpoint for CloudTrail where services in private subnets call its API.
Operating it
What to watch, and the limits
| Watch | Why |
|---|---|
| Trail logging status | IsLogging from GetTrailStatus; alarm if a trail stops logging. |
| LatestDeliveryError | Delivery failures to S3, often from a changed bucket policy or KMS key policy. |
| StopLogging, DeleteTrail and UpdateTrail events | Changes to the trail itself; alert security on any of them. |
| Unexpected roles on restricted buckets | Rows in ops.fct_access where a role other than the Unity Catalog storage credential read a restricted bucket. |
| KMS Decrypt by principal | Who used the restricted catalog's key; compare with the expected service roles. |
| Insights events | Unusual API call or error rates flagged by CloudTrail Insights, if turned on. |
| Limit | Value and notes |
|---|---|
| Trails | 5 per Region per account (cannot be increased) |
| Event history | 90 days of management events, free |
| Event size | 256 KB maximum per event (event version 1.05 and newer) |
| Data resources in basic event selectors | 250 across all event selectors in a trail |
| Advanced event selectors | 500 condition values in total per trail |
Limits and quotas checked 2026-11-11; many can be raised through Service Quotas.
Decisions
Situations and verdicts
| Situation | Choice | Verdict |
|---|---|---|
| Landing zone audit for all accounts | Organization trail to the log-archive account, integrity validation, SCPs protecting it | Pursue: the base of every audit and incident question. |
| Proof of who read compound recipes | S3 data events on the recipe bucket and KMS events on its key, joined with Databricks audit tables in ops.fct_access | Pursue: shows reads that went around Unity Catalog. |
| S3 data events on landing and bronze buckets | Not logged; Databricks audit and the run log cover these paths | Drop: high cost and little audit value. |
| New SQL query store for audit events | Trail files in S3 read by Databricks, or CloudWatch if a native AWS tool is required | Drop CloudTrail Lake: closed to new customers since 31 May 2026. |
FAQ
Questions people ask
Is CloudTrail Lake being discontinued?
CloudTrail Lake is closed to new customers since 31 May 2026. Existing customers can keep using it, with critical fixes only, and AWS recommends migrating to CloudWatch. CloudTrail itself, including trails and Insights, is fully supported.
Does CloudTrail log S3 reads by default?
No. S3 object reads and writes are data events, which are off by default. Turn them on for chosen buckets with advanced event selectors, and accept the per-event charge.
Can CloudTrail tell me which user queried a Databricks table?
Not directly. Databricks reads S3 with the Unity Catalog storage credential's role, so CloudTrail shows the role. The Databricks audit system table shows the person; join the two for the full picture.
How long does CloudTrail keep events?
Event history keeps 90 days of management events for free. A trail keeps events in your S3 bucket for as long as your lifecycle rules say.
How quickly do CloudTrail events arrive?
Trail files usually arrive in S3 within minutes of the call, though this is not guaranteed. For faster reactions, use EventBridge rules on CloudTrail management events.
Sources
Checked against
- AWS docs: What is AWS CloudTrail
- AWS docs: CloudTrail Lake availability change
- AWS docs: Quotas in AWS CloudTrail
- AWS: CloudTrail pricing
Checked 2026-11-11.
Related
Where it connects
AWS and Databricks reference platform · AWS Organizations, Control Tower and SCPs · AWS KMS · Amazon CloudWatch · Amazon Macie · All AWS data services
← AWS Backup · CloudWatch →