Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.3.2. CloudTrail, CloudTrail Lake, and Log Analysis

šŸ’” First Principle: CloudTrail records every API call in your AWS account — who did what, when, from where, and what happened. If CloudWatch answers "is the system healthy?", CloudTrail answers "who touched the system?" This is the foundation of security auditing, compliance, and incident investigation for data pipelines.

CloudTrail captures management events (API calls that create, modify, or delete AWS resources) by default. Data events (S3 object-level operations, Lambda invocations, DynamoDB item-level operations) require explicit configuration and incur additional cost. For data engineering, data events are critical — they reveal who accessed which S3 objects and when.

CloudTrail Lake stores CloudTrail events in a managed, queryable data store. Instead of sending trail logs to S3 and querying them with Athena (the traditional approach), CloudTrail Lake provides a built-in SQL query interface with faster performance and simpler setup. Use it for centralized security queries across accounts and regions.

Log analysis patterns tested on the exam:
Log SourceAnalysis ServiceUse Case
Application logsCloudWatch Logs InsightsDebugging pipeline failures
API audit trailsCloudTrail Lake or AthenaSecurity investigation, compliance
High-volume logsAmazon OpenSearchInteractive search, dashboards
Large-scale log ETLAmazon EMRProcessing TB+ of log data

āš ļø Exam Trap: CloudTrail logs API calls, not application-level data access. If a question asks "who queried this Redshift table?", the answer is Redshift audit logging (not CloudTrail). CloudTrail would show who called the Redshift API (created a cluster, modified settings), but not the SQL queries executed within Redshift.

Reflection Question: Security needs to investigate whether any IAM user accessed a specific S3 bucket containing PII data during the last 30 days. Which service provides this information, and what event type must be enabled?

Alvin Varughese
Written byAlvin Varughese
Founder•15 professional certifications