Q37 — AWS DOP-C02 Ch.3
Question 37 of 100 | ← Chapter 3
A company is migrating its container-based applications to Amazon EKS and wants to establish automated email notifications. Notifications sent to each email address must correspond to specific events related to EKS components. The solution will include Amazon SNS topics and an AWS Lambda function to evaluate log events and publish messages to the appropriate SNS topic. Which logging solution supports these requirements?
- A. Enable Amazon CloudWatch Logs to capture EKS component logs. Use Lambda as a subscription destination and create a CloudWatch Logs subscription filter for each component. ✓
- B. Enable Amazon CloudWatch Logs to capture EKS component logs. Create a CloudWatch Logs Insights query linked to an Amazon EventBridge event that invokes Lambda.
- C. Enable Amazon S3 logging for EKS components. Use Lambda as a subscription destination and configure an Amazon CloudWatch Logs subscription filter for each component.
- D. Enable Amazon S3 logging for EKS components. Configure S3 PUT object event notifications with AWS Lambda as the target.
Correct Answer: A. Enable Amazon CloudWatch Logs to capture EKS component logs. Use Lambda as a subscription destination and create a CloudWatch Logs subscription filter for each component.
Explanation
EKS application logs require real-time processing and triggering of Lambda to send notifications. Amazon CloudWatch Logs supports subscription filters that stream log events in real time to Lambda, enabling per-component filtering. Option A is correct because CloudWatch subscription filters directly route log events to Lambda for real-time processing, matching the requirement. Option B relies on Insights queries rather than real-time streaming; Options C and D use S3 logging, which lacks real-time triggering capability. AWS documentation confirms CloudWatch subscription filters can route log events to Lambda in real time, suitable for immediate-response scenarios.