An AWS Chatbot client is configured in your AWS account that can send notifications to the Slack workspace of your team.
The team starts to manage Git repositories in AWS CodeCommit.
In order to monitor important changes of source code, you need to set up a rule to notify users whenever a pull request is created and merged in the repositories.
The notifications should be sent to the Slack channel through the AWS Chatbot client.
How would you create the notification?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer : B.
Option A is incorrect because in a notification rule, there are two target types: SNS topic and AWS Chatbot (Slack)
In this scenario, AWS Chatbot (Slack) should be selected:
Option B is CORRECT because you can create a notification rule in a CodeCommit repository and select the events that trigger notifications:
Then you can register the AWS Chatbot client as the target.
Option C is incorrect because you cannot set up the CodeCommit notification rule through the AWS Chatbot client.
The rule needs to be configured in the AWS CodeCommit console.
Option D is incorrect because this is not how a notification rule is created in CodeCommit.
You do not need to create a new SNS topic for this.
Reference:
https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html, https://docs.aws.amazon.com/codecommit/latest/userguide/notification-rule-create.htmlThe correct answer for this question is A. Create a notification rule in the CodeCommit repository, select the pull request events, choose “SNS topic” in the target type and input the SNS topic ARN of the AWS Chatbot client.
To set up notifications for pull request events in AWS CodeCommit repositories and send them to a Slack channel through an AWS Chatbot client, you need to follow these steps:
Create an AWS Chatbot client: First, you need to create an AWS Chatbot client in your AWS account and configure it to send notifications to your Slack workspace. To do this, you can follow the steps provided in the AWS Chatbot documentation.
Create an SNS topic: Next, you need to create an SNS topic in your AWS account. An SNS topic is a logical access point that allows you to publish messages to multiple subscribers. In this case, the SNS topic will be used to publish notifications about pull request events in your CodeCommit repositories.
Subscribe the AWS Chatbot client ID to the SNS topic: After creating the SNS topic, you need to subscribe the AWS Chatbot client ID to the topic. This will allow the Chatbot client to receive notifications whenever a new message is published to the topic.
Create a notification rule in the CodeCommit repository: Now that you have set up the AWS Chatbot client and the SNS topic, you can create a notification rule in your CodeCommit repository. To do this, go to the CodeCommit console and select the repository you want to set up notifications for. Then, click on the "Settings" tab and choose "Notification rules". Click on "Create rule" and select "Pull request created" and "Pull request merged" as the events that trigger the notification.
Choose “SNS topic” in the target type: After selecting the events, choose "SNS topic" in the target type drop-down menu. Then, enter the ARN of the SNS topic you created in step 2.
Customize the notification information: Optionally, you can customize the information that will be included in the notification message. You can include details such as the repository name, pull request title, and author.
Save the notification rule: Once you have set up the notification rule, click "Create" to save it. Now, whenever a pull request is created or merged in the repository, a notification will be sent to the Slack channel through the AWS Chatbot client.