Correct Answer – B
To automatically trigger pipeline with changes in the source S3 bucket, Amazon CloudWatch Events rule & AWS CloudTrail trail must be applied. When there is a change in the S3 bucket, events are filtered using AWS CloudTrail & then Amazon CloudWatch events are used to trigger the start of the pipeline. This default method is faster & periodic checks should be disabled to have events-based triggering of CodePipeline.
You can use the following tools to monitor your CodePipeline pipelines and their resources:
Amazon CloudWatch Events — Use Amazon CloudWatch Events to detect and react to pipeline execution state changes (for example, send an Amazon SNS notification or invoke a Lambda function).
AWS CloudTrail — Use CloudTrail to capture API calls made by or on behalf of CodePipeline in your AWS account and deliver the log files to an Amazon S3 bucket. You can choose to have CloudWatch publish Amazon SNS notifications when new log files are delivered so you can take quick action.
Console and CLI — you can use the CodePipeline console and CLI to view details about the status of a pipeline or a particular pipeline execution.
Option A is incorrect as Webhooks are used to trigger pipeline when the source is GitHub repository. Also, the periodic check will be a slower process to trigger CodePipeline.
Option C is incorrect as Periodic checks are not a faster way to trigger CodePipeline.
Option D is incorrect as Webhooks are used to trigger pipeline when the source is GitHub repository.
For more information on Automatically Triggering Pipeline, refer to the following URL:
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-about-starting.html