SOA-C02 Question 41
Single answerYour company uses an S3 bucket to store logs from various applications. You are tasked with automating a process to notify an operations team through an Amazon SNS topic whenever a new log file is uploaded to the S3 bucket. How can you achieve this using Amazon EventBridge?
- A
Create an EventBridge rule with an event pattern that matches S3 PutObject events and set the target as the SNS topic.
- B
Enable EventBridge on the S3 bucket and configure it to send events directly to the SNS topic.
- C
Create an EventBridge rule with an event pattern that matches S3 DeleteObject events and set the target as the SNS topic.
- D
Create a CloudWatch alarm for the S3 bucket and use EventBridge to forward the alarm notifications to the SNS topic.
Show answer and explanation
Correct answer: A
Explanation
To notify the operations team whenever a new file is uploaded to the S3 bucket, you can use Amazon EventBridge. Create a rule with an event pattern that matches S3 PutObject events. The target for the rule should be the Amazon SNS topic that sends the notifications. This approach avoids unnecessary complexity and directly uses EventBridge's integration with S3 and SNS.
- A. Correct.
Correct: EventBridge rules can be configured with an event pattern to match specific S3 events, such as PutObject, and forward them to an SNS topic as the target.
- B. Incorrect.
Incorrect: EventBridge does not require enabling on an S3 bucket; instead, you configure event patterns in EventBridge rules to match events from S3.
- C. Incorrect.
Incorrect: DeleteObject events are not relevant to the requirement, which specifies triggering notifications for new uploads (PutObject events).
- D. Incorrect.
Incorrect: A CloudWatch alarm is not necessary for this scenario. Logs uploaded to S3 can directly trigger EventBridge rules without involving CloudWatch alarms.