CloudWatch & CloudTrail

AWS SAA SAA-C03 · Design Secure Architectures

By Abu Anns · Last updated 20 November 2026Exam version: SAA-C03 (current)

CloudWatch: metrics, logs, and alarms

Amazon CloudWatch is the monitoring and observability service for AWS. It collects metrics — time-ordered data points about a resource, such as EC2 CPU utilization, an ALB's request count, or a DynamoDB table's consumed capacity — and lets you graph them, set alarms on them, and trigger actions when thresholds are crossed. EC2 instances report basic metrics (CPU, network, disk) every 5 minutes by default; detailed monitoring shortens this to 1 minute, which matters when alarms need to react quickly. You can also publish custom metrics from your own applications, and use metric filters to turn patterns in log data into metrics.

CloudWatch Logs collects, stores, and searches log data from EC2 instances (via the CloudWatch agent), Lambda functions, and many AWS services. Log data is organized into log groups and log streams, and you can set retention periods, export logs to S3, and stream them to Lambda or OpenSearch for analysis. CloudWatch Alarms watch a metric and change state (OK, ALARM, INSUFFICIENT_DATA) when a threshold is breached; an alarm can send a notification through SNS, trigger an Auto Scaling policy, or even stop, terminate, reboot, or recover an EC2 instance. CloudWatch Events — now part of Amazon EventBridge — routes events and runs scheduled actions. CloudWatch Dashboards visualize metrics in one place, and CloudWatch Synthetics runs canaries that probe your endpoints to detect outages before users do. AWS X-Ray complements CloudWatch by tracing requests as they flow through a distributed application, showing where time is spent and where errors occur.

CloudTrail: who did what

AWS CloudTrail records API activity in your account: who called which API, from where, with what parameters, and whether the call succeeded. It answers the auditing question “who did what, when?” — who deleted that S3 bucket, who changed that security group, who launched those instances. CloudTrail records management events (control-plane operations like creating resources) by default, and you can enable data events for high-volume operations such as S3 object reads and Lambda invocations. A trail delivers these events to an S3 bucket (and optionally to CloudWatch Logs) for storage and analysis. Trails can be configured for all Regions, and log file validation can detect whether log files were tampered with after delivery. For security, the S3 bucket holding CloudTrail logs should itself be protected — encrypted, with restricted access, and ideally with MFA Delete or Object Lock so logs cannot be erased by an attacker covering their tracks.

The exam tests the CloudWatch versus CloudTrail distinction constantly. The rule is simple: CloudWatch monitors performance and health (metrics, logs, alarms), while CloudTrail audits API activity (who did what). If a question asks how to detect that someone changed a security group, the answer is CloudTrail. If it asks how to be alerted when CPU exceeds 80%, the answer is a CloudWatch alarm. The two services often work together: CloudTrail can send events to CloudWatch Logs, where metric filters and alarms can trigger notifications on specific API calls.

Config, GuardDuty, Security Hub, and the security toolkit

AWS Config records the configuration of AWS resources over time and evaluates them against rules. It answers “what does my infrastructure look like, and does it comply with my rules?” — for example, flagging any S3 bucket that is not encrypted, or any security group that allows unrestricted SSH. Config rules can trigger automatic remediation through Systems Manager Automation documents. AWS GuardDuty is a threat-detection service that uses machine learning and threat intelligence to flag suspicious activity: unusual API calls, compromised EC2 instances communicating with known malicious hosts, cryptocurrency mining, and suspicious S3 access. Amazon Inspector scans EC2 instances and container images for software vulnerabilities and unintended network exposure. AWS Security Hub aggregates findings from GuardDuty, Inspector, Config, and other services into a single view, and checks resources against security standards like the CIS AWS Foundations Benchmark. AWS Trusted Advisor checks your account against best practices in cost optimization, performance, security, fault tolerance, and service limits — the exam's answer for “how do I find cost savings and best-practice violations across my account?” AWS Systems Manager rounds out the operations toolkit: it patches fleets (Patch Manager), runs commands across instances (Run Command), stores parameters and secrets (Parameter Store), and automates operational tasks.

Monitoring design judgment

Good monitoring design in the exam follows a pattern: collect the right signals (metrics for performance, logs for detail, CloudTrail for auditing), alert on what matters (alarms on thresholds that indicate real problems, not noise), and automate the response where possible (Auto Scaling policies, Lambda remediation, SNS notifications). The cheapest alarm is the one that pages someone at 3 AM only when something is actually wrong — and the most expensive monitoring failure is discovering a problem from your users instead of your dashboards.

Centralized logging, audit, and operations at scale

As an AWS footprint grows, monitoring moves from single-account checks to centralized patterns. CloudWatch Logs Insights lets you run interactive queries over log data — finding the slowest requests, counting errors by type, or tracing a single request ID across services — without exporting logs anywhere. Metric filters turn log patterns into metrics, so a phrase such as “ERROR” in application logs becomes a countable metric with an alarm attached. For audit at scale, an organization CloudTrail trail created in the management account of an AWS Organization records API activity across every member account into a central S3 bucket, giving the security team one place to look. CloudTrail log file validation uses digest files to detect whether log files were modified or deleted after delivery.

AWS Security Hub aggregates findings from GuardDuty, Inspector, Config, Macie, and other services into one console, and continuously checks resources against security standards such as the CIS AWS Foundations Benchmark and the AWS Foundational Security Best Practices standard, producing a compliance score per account. AWS Systems Manager is the operations hub: Patch Manager automates patching across fleets on a schedule with approval rules; Run Command executes commands on many instances at once without SSH; Session Manager provides browser-based shell access to instances without opening inbound ports or managing SSH keys; and Automation documents define runbooks for repeatable operational tasks. Amazon EventBridge ties these services together: it routes events from AWS services and your own applications to targets such as Lambda functions, SNS topics, or Step Functions workflows, and it can run targets on a schedule. A common exam pattern is an EventBridge rule that triggers a Lambda function in response to a specific CloudTrail event — for example, automatically remediating a security group change the moment it happens.

One last operational detail: CloudWatch Logs retention is configurable per log group, from one day to ten years, and expired log data is deleted automatically. For long-term retention, export logs to S3, where lifecycle policies can move them to cheaper storage classes. Metric math lets you combine metrics in alarms and dashboards — for example, computing an error rate by dividing one metric by another.

Advertisement

Exam traps to watch for

Practice questions

Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.

Q1.A security group protecting a production database was modified yesterday, and the security team needs to find out which IAM user made the change and from which IP address. Which AWS service provides this information?

Report an error

Q2.A company wants to be notified by email whenever the average CPU utilization of its EC2 Auto Scaling group exceeds 80% for 5 minutes. Which solution meets this requirement?

Report an error

Q3.A company needs to detect whether any S3 bucket in its account becomes publicly accessible, and to be alerted immediately when it happens. Which combination of services BEST meets this requirement?

Report an error

Q4.A company's EC2 instance is communicating with an IP address known to be associated with malicious activity, and cryptocurrency mining software may have been installed. Which AWS service is DESIGNED to detect this kind of threat?

Report an error

Q5.A solutions architect needs to find cost optimization opportunities, unused resources, and security best-practice violations across an AWS account. Which service provides these checks in one place?

Report an error

Q6.An application writes custom performance data (orders processed per minute) to Amazon CloudWatch as a custom metric. The operations team wants an alarm that fires within 1 minute of the metric dropping to zero. Which monitoring configuration is required?

Report an error

Q7.A distributed application spans several microservices, and the team needs to trace individual requests across services to find where latency is introduced. Which AWS service is designed for this?

Report an error

Q8.A company stores CloudTrail logs in an S3 bucket. The security team is concerned that an attacker who gains administrative access could delete the logs to hide their activity. Which solution BEST protects the integrity of the logs?

Report an error