CloudWatch & CloudTrail
AWS SAA SAA-C03 · Design Secure Architectures
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.
Exam traps to watch for
- Confusing CloudWatch with CloudTrail: CloudWatch monitors performance and health (metrics, logs, alarms); CloudTrail audits API activity (who did what).
- Forgetting that CloudTrail data events (S3 object-level activity, Lambda invocations) are not enabled by default — only management events are.
- Expecting Config to detect threats. Config evaluates resource configuration against rules; GuardDuty detects threats and suspicious behavior.
- Using the default 5-minute EC2 metrics when an alarm needs to react fast. Detailed monitoring (1-minute metrics) is the fix.
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?
Explanation: CloudTrail records API activity, including who made each call, from which IP address, and with what parameters — so it can identify exactly who modified the security group. Option C monitors performance metrics and logs, not API callers. Option D records the configuration history of the security group (what it looks like now versus before) but not the identity of the caller. Option B detects threats and suspicious behavior; it does not provide an audit trail of API calls.
Exam objective: SAA-C03 Task Statement 1.2: Design secure workloads and applications
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?
Explanation: A CloudWatch alarm watches the CPUUtilization metric and, when the threshold is breached for the configured period, triggers an SNS notification that can send the email. Option A records API calls, not CPU metrics. Option B logs network traffic, not CPU. Option D is wrong: Config evaluates resource configurations against rules; it does not monitor performance metrics or send threshold alerts.
Exam objective: SAA-C03 Task Statement 1.2: Design secure workloads and applications
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?
Explanation: AWS Config continuously evaluates resource configurations against rules — including a managed rule that flags public S3 buckets — and can notify via SNS and even remediate automatically. Option A is indirect: access logs show requests, not the bucket's public status. Option C relies on weekly manual review, which is neither immediate nor automated. Option B is wrong: Inspector scans EC2 instances and container images for vulnerabilities, not S3 bucket policies.
Exam objective: SAA-C03 Task Statement 1.2: Design secure workloads and applications
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?
Explanation: GuardDuty is a threat-detection service that analyzes CloudTrail events, VPC Flow Logs, and DNS logs with machine learning and threat intelligence to flag compromised instances, malicious IPs, and cryptocurrency mining. Option A records the API activity but does not analyze it for threats. Option B checks resource configuration compliance. Option C checks best practices for cost, performance, and security posture — it does not detect active threats.
Exam objective: SAA-C03 Task Statement 1.2: Design secure workloads and applications
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?
Explanation: Trusted Advisor checks an account against best practices in five categories — cost optimization, performance, security, fault tolerance, and service limits — and reports findings such as idle instances, unassociated Elastic IPs, and exposed access keys. Option A monitors metrics, not best practices. Option D audits API calls. Option C scans for software vulnerabilities on instances and container images, not account-wide cost and best-practice checks.
Exam objective: SAA-C03 Task Statement 4.2: Design cost-optimized compute solutions
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?
Explanation: A CloudWatch alarm can evaluate a metric every minute (or even every 10 seconds with high-resolution alarms), so a 1-minute alarm period on the custom metric detects the drop within a minute. Option A evaluates every 5 minutes, which misses the 1-minute requirement. Option D records API activity, not application metrics. Option C logs network traffic and cannot measure orders processed.
Exam objective: SAA-C03 Task Statement 1.2: Design secure workloads and applications
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?
Explanation: AWS X-Ray traces requests as they travel through a distributed application, showing a service map and the time spent in each service, so the team can pinpoint where latency comes from. Option C records AWS API calls, not application request flows. Option D detects security threats. Option B tracks resource configuration history.
Exam objective: SAA-C03 Task Statement 1.2: Design secure workloads and applications
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?
Explanation: Versioning preserves deleted objects, MFA Delete requires a second factor to permanently delete object versions, and a restrictive bucket policy limits who can touch the logs at all — together they make it very hard for an attacker to erase the audit trail (Object Lock would strengthen this further). Option C monitors performance metrics and does nothing for log protection. Option D is the opposite of best practice: audit logs are safer in a separate, restricted account. Option A speeds uploads and is unrelated to protection.
Exam objective: SAA-C03 Task Statement 1.3: Determine appropriate data security controls