Answer – B
The AWS Documentation mentions the following.
Amazon CloudWatch is a monitoring and management which collects monitoring and operational data in the form of logs, metrics, and events, providing you with a unified view of AWS resources, applications and services that run on AWS, and on-premises servers. It captures real-time events which can be further used to trigger AWS Lambda.
AWS CloudTrail is an AWS service that helps you enable governance, compliance, and operational and risk auditing of your AWS account. Actions taken by a user, role, or an AWS service are recorded as events in CloudTrail. Events include actions taken in the AWS Management Console, AWS Command Line Interface, and AWS SDKs and APIs. It doesn’t have the capability to trigger anything.
For more details on the process, refer below URL-
https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/Create-CloudWatch-Events-Rule.html
Option C is incorrect since this is used to working with messages in the queue.
Option D is incorrect CloudWatch Log cannot trigger the Lambda function based on real-time events. There is some delay for the logs to be sent to CloudWatch Logs.
For more information on AWS CloudWatch, please visit the below URL-
https://aws.amazon.com/cloudwatch/