AWS · Management and Governance

AWS CloudTrail

Records the API calls made in your AWS accounts, who made them and from where, for auditing, security investigations and compliance.

On the SAA-C03 exam listAuditing and complianceMonitoring and observability

What it is and what problem it solves

AWS CloudTrail records actions taken in your account as events: calls from the console, CLI, SDKs and AWS services. Each event says who acted, what they did, when, from which IP address, and whether it succeeded.

Event history shows the last 90 days of management events in each Region with no setup. A trail delivers events continuously to S3 (and optionally CloudWatch Logs) for long-term retention; an organisation trail covers every account. Management events cover control-plane actions (creating a bucket, changing a security group); data events cover high-volume data-plane actions (reading S3 objects, invoking Lambda) and must be enabled. CloudTrail Lake stores events for SQL queries, and Insights detects unusual API activity.

Someone changesa security groupCloudTrailWHO did WHAT, WHEN (API call)AWS ConfigWHAT it looked like before/afterS3 + log validationCloudTrail Lake for SQLConfig rule: NON_COMPLIANT→ auto-remediate
CloudTrail records the API call; Config records the resource's configuration and judges compliance

When to use it

  • Every account: an organisation trail to a central, locked-down S3 bucket is a standard baseline.
  • Investigating who changed or deleted a resource.
  • Compliance audits that require a record of administrative activity.

When to avoid it

  • Performance metrics and application logs: CloudWatch.
  • Resource configuration history and compliance rules: AWS Config (CloudTrail says who called the API; Config shows what the resource looked like).
  • Network traffic records: VPC Flow Logs.

Limits and quotas

ItemValueContextSource
Event history 90 days of management events per Region Viewable without creating a trail. Source
checked
Trails per Region 5 Source
checked

Quotas and limits change. Check the linked source before designing around a number.

Cost model

What you pay for

The first copy of management events delivered by a trail is free; additional copies, data events, Insights events and CloudTrail Lake ingestion and storage are charged, plus S3 storage for log files.

Where it is cost-efficient

One organisation trail for management events to a central bucket.

Where costs grow

Data events for busy S3 buckets or Lambda functions across all resources, and several duplicate trails.

Cost controls and common surprises

Enable data events only for sensitive resources, use advanced event selectors, avoid duplicate trails, and apply S3 lifecycle rules to old logs.

Prices differ by Region and change over time; see the pricing page linked under Sources.

Security

Controls the service provides

Log file integrity validation (digest files), SSE encryption (optionally KMS), and organisation trails that member accounts cannot change.

What you configure

Send logs to a separate logging account, protect the bucket (Object Lock, restricted policies, MFA delete), enable integrity validation, and alert on trail changes.

Logging and monitoring

CloudTrail is the audit log; send it to CloudWatch Logs for alarms on specific API calls.

Related security services

S3, KMS, CloudWatch, EventBridge, Athena, GuardDuty.

Shared responsibility

AWS records the events. You keep the logs, protect them and review them.

Common service combinations

Organizations (organisation trail), S3 with Object Lock, Athena for queries, EventBridge rules on API calls, GuardDuty (which reads CloudTrail).

Business application examples

  • Finding who deleted a production database snapshot and when.
  • An alarm that fires whenever someone signs in as the root user.

Exam cues and common confusions

  • Who did what, when (API activity): CloudTrail. What changed in a resource's configuration: Config. Metrics and logs: CloudWatch.
  • Prove log files weren't changed: log file integrity validation.
  • All accounts: an organisation trail.
  • Object-level S3 or Lambda invoke activity: data events (not on by default).

Related

Courses and lessons

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake