AWS DevOps Monitoring and Logging 2 — Questions and Answers
Question 1: A DevOps team wants to automatically remediate EC2 instances that fail health checks without human intervention. Which AWS service combination best achieves this?
- CloudWatch Alarms + SNS + Lambda
- CloudTrail + EventBridge + Systems Manager Automation
- CloudWatch Alarms + EventBridge + Systems Manager Automation (Correct answer)
- Config Rules + Lambda + SNS
Correct answer: CloudWatch Alarms + EventBridge + Systems Manager Automation
CloudWatch Alarms detect the failure, EventBridge routes the event, and Systems Manager Automation runbooks execute the remediation steps.
Question 2: Which CloudWatch feature allows you to search, analyze, and visualize log data interactively using a purpose-built query language?
- CloudWatch Metric Filters
- CloudWatch Log Insights (Correct answer)
- CloudWatch Contributor Insights
- CloudWatch Synthetics
Correct answer: CloudWatch Log Insights
CloudWatch Log Insights provides an interactive query interface with its own query language to analyze log data in real time.
Question 3: A pipeline deployment causes elevated 5xx errors. The team needs to correlate ALB access logs with Lambda function logs across a 15-minute window. Which tool provides the best cross-service log correlation?
- CloudWatch Log Insights with multiple log group queries
- AWS X-Ray with trace ID propagation (Correct answer)
- AWS CloudTrail Lake
- Amazon OpenSearch Service Dashboards
Correct answer: AWS X-Ray with trace ID propagation
X-Ray propagates trace IDs across services, enabling end-to-end correlation of requests through ALB, Lambda, and other components.
Question 4: What is the maximum retention period you can configure for a CloudWatch Log Group?
- 90 days
- 1 year
- 10 years
- Logs are retained indefinitely by default unless a retention policy is set (Correct answer)
Correct answer: Logs are retained indefinitely by default unless a retention policy is set
By default, CloudWatch Log Groups retain logs indefinitely; you must explicitly set a retention policy to limit storage duration.
Question 5: A company uses AWS CodePipeline and wants pipeline execution metrics (success rate, duration) to appear in a central dashboard. Which approach is most operationally efficient?
- Parse CloudTrail logs with Athena and build Grafana charts
- Use CodePipeline EventBridge events to push custom metrics to CloudWatch, then build a dashboard (Correct answer)
- Enable CodePipeline detailed monitoring and view in the console
- Export pipeline logs to S3 and use QuickSight
Correct answer: Use CodePipeline EventBridge events to push custom metrics to CloudWatch, then build a dashboard
EventBridge captures CodePipeline state-change events; a Lambda function can extract duration and status and publish custom CloudWatch metrics for dashboarding.
Question 6: Which AWS service provides pre-built runbooks for common operational tasks like patching and is triggered automatically by CloudWatch Alarms?
- AWS OpsWorks
- AWS Systems Manager Automation (Correct answer)
- AWS Elastic Beanstalk Health
- AWS Config Remediation
Correct answer: AWS Systems Manager Automation
Systems Manager Automation contains AWS-managed and custom runbooks that can be invoked by CloudWatch Alarms via EventBridge targets.
Question 7: A team wants to detect when any IAM policy is modified in their account and trigger a notification within seconds. Which combination is most appropriate?
- AWS Config with a managed rule + SNS
- CloudTrail + CloudWatch Logs metric filter + CloudWatch Alarm + SNS (Correct answer)
- GuardDuty finding + EventBridge + SNS
- Trusted Advisor + SNS
Correct answer: CloudTrail + CloudWatch Logs metric filter + CloudWatch Alarm + SNS
CloudTrail logs IAM API calls; a metric filter detects the specific event, a CloudWatch Alarm fires, and SNS sends the notification in near real time.
A DevOps team wants to automatically remediate EC2 instances that fail health checks without human intervention.
Which AWS service combination best achieves this?