Arkinu
AWS service comparison

AWS CloudTrail vs Amazon CloudWatch: differences and when to use each

AWS CloudTrail
Amazon CloudWatch

Often confused on the examQuestions tend to offer one as a distractor for the other: look for the phrase in the scenario that tips the balance.

Management and Governance

AWS CloudTrail

On the radar· CloudTrail Lake no longer accepts new customers

Service that records the actions taken by users, roles, and services in an AWS account as events, whether made from the console, the CLI, the SDKs, or the APIs. It answers who did what, on which resource, and when, for auditing, governance, and compliance.

Exam phrases that point here

  • «record which user made each API call, when, and from where»

    CloudTrail stores an event for every API call, made from the console, the CLI, or the SDKs, with who made it, what action, with what parameters, and what the service responded.

    When not: If the question asks how a resource was configured at each point in time or whether it complies with a rule, it is AWS Config. If it asks about CPU usage, latency, or application errors, it is Amazon CloudWatch.

  • «prove that audit records were not modified or deleted after delivery»

    CloudTrail log file integrity validation delivers signed digest files every hour with the hashes of the logs; with them you can check whether a file changed or disappeared.

    When not: Validation detects changes, it does not prevent them. If the requirement is to prevent anyone from deleting or overwriting the logs, it is combined with controls on the S3 bucket, such as MFA Delete, bucket policies, or S3 Object Lock.

  • «record the activity of all accounts in the organization in a single bucket»

    An organization trail, created from the management account or a delegated administrator, records the events of all member accounts and delivers them to a single S3 bucket; member accounts cannot modify it.

    When not: If what you want to centralize is the compliance status of the configuration, it is an AWS Config aggregator; if it is security findings from multiple services, AWS Security Hub CSPM.

  • «record who read or wrote objects in an S3 bucket or invoked a Lambda function»

    Those operations are CloudTrail data events: high-volume activity on the resources themselves, which you have to enable on the trail for the chosen resources.

    When not: Data events are not recorded by default and have a separate cost. A trail with the default configuration records only management events (creating, modifying, or deleting resources).

  • «detect an unusual volume of API calls»

    CloudTrail Insights learns the account's normal volume of calls and generates events when it deviates, for example because of a runaway script.

    When not: If the scenario talks about threats, such as compromised credentials or communication with malicious addresses, the clue points to Amazon GuardDuty, which analyzes CloudTrail among other sources.

  • «react immediately when someone performs a specific action in the account»

    With an active trail, API calls arrive as events on the default Amazon EventBridge event bus, where a rule can filter them and send a notification or take corrective action.

    When not: Read-only calls (Get, List, Describe) are not received by a normal rule: they require a special rule state. And if the change to watch for is the violation of a configuration rule, AWS Config with remediation is usually a better fit.

Often paired with

  • Amazon S3
  • Amazon CloudWatch
  • Amazon EventBridge
Study AWS CloudTrail →

Management and Governance

Amazon CloudWatch

Service for monitoring AWS resources and applications in real time. It collects metrics and logs, displays dashboards, and triggers alarms that notify you or take actions when a threshold is breached.

Exam phrases that point here

  • «monitor performance metrics and get an alert when a threshold is exceeded»

    CloudWatch collects metrics from AWS resources and applications, and its alarms compare each metric against a threshold to send a notification (for example, with Amazon SNS) or take action.

    When not: If the question is who made an API call or which user changed something, the clue points to AWS CloudTrail; if it is whether a resource's configuration complies with a policy, to AWS Config.

  • «collect memory and disk metrics from EC2 instances»

    The metrics that EC2 sends by default are measured from outside the instance. For guest operating system metrics, such as memory or disk usage, you install the CloudWatch agent, which also works for on-premises servers.

    When not: If what is asked for is the API calls on those instances, it is CloudTrail. And if the team wants container metrics in Prometheus format queried with Prometheus tools, Amazon Managed Service for Prometheus may be a better fit.

  • «centralize application logs and query them interactively»

    CloudWatch Logs receives logs from the agent and from many AWS services, and CloudWatch Logs Insights lets you query them without any prior preparation.

    When not: If the record of interest is the account's API call history for auditing, it is CloudTrail. If the question asks for full-text search and large-scale log analytics dashboards, Amazon OpenSearch Service may also appear.

  • «automatically stop, reboot, or recover an EC2 instance when a check fails»

    An alarm on an EC2 metric can directly run an action on the instance: stop it, terminate it, reboot it, or recover it.

    When not: If the goal is to replace unhealthy instances within a fleet, this is usually done by an Amazon EC2 Auto Scaling group with its health checks, not an alarm per instance.

  • «count the number of times an error appears in the logs and alert when it keeps happening»

    A metric filter turns the log lines that match a pattern into a CloudWatch metric, and an alarm is created on that metric.

    When not: The metric filter only counts events after its creation. If the error to detect is a specific API call (for example, deleting a trail), you can react to the CloudTrail event with Amazon EventBridge.

Often paired with

  • Amazon SNS
  • Amazon EC2 Auto Scaling
Study Amazon CloudWatch →