Add notification integration with AWS chatbot
Is your feature request related to a problem? Please describe.
It will be very useful to monitor build status in Slack. AWS Chatbot makes it easy to integrate SNS to slack without having to create lambda functions.
Describe the solution you'd like
Have AWS Chatbot support events from amplify.
Additional context
Currently, we can listen for notifications using SNS and lambda. But having AWS Chatbot support the notification out of the box would make our life easier.
I'm also very interested in this feature
Duplicate of #943
@jimmyn @kkesley-shine while we add support there is workaround today. If you enable Email notifications in the Amp console we actually create an SNS topic for you which you can then configure to connect to Slack: https://medium.com/cohealo-engineering/how-set-up-a-slack-channel-to-be-an-aws-sns-subscriber-63b4d57ad3ea.
What are some additional things you'd like to see?
I think there are also EventBridge events right? If so you could probably use the new API Destinations to integrate directly w/ slack without a lambda:
- https://aws.amazon.com/blogs/compute/using-api-destinations-with-amazon-eventbridge/
- https://acloudguru.com/blog/engineering/how-to-integrate-your-workload-with-slack-using-amazon-eventbridge-api-destinations
@swaminator I think the lambda option was covered in the initial issue:
Currently, we can listen for notifications using SNS and lambda. But having AWS Chatbot support the notification out of the box would make our life easier.
I think having native chatbot support is nicer - no need for an extra lambda to manage, Chatbot can handle nicely formatting the build notification slack message, etc.
I was able to set up an Event Grid rule that got this more or less working. I then added the Chatbot as a subscription to the SNS topic. the transformed event is able to be read by the chatbot, but it's not super pretty. If someone could find better documentation for what inputs the ChatBot looks for, this could be improved.
Event Pattern:
{
"detail": {
"appId": ["<<my amplify app id>>"],
"jobStatus": ["SUCCEED", "FAILED", "STARTED"]
},
"detail-type": ["Amplify Deployment Status Change"],
"source": ["aws.amplify"]
}
Target: SNS Topic
Input Transformer:
{"account":"$.account","appId":"$.detail.appId","branch":"$.detail.branchName","detail-type":"$.detail-type","id":"$.id","jobId":"$.detail.jobId","region":"$.region","resources":"$.resources","source":"$.source","status":"$.detail.jobStatus","time":"$.time","version":"$.version"}
{
"version": <version>,
"id": <id>,
"detail-type": "<status> build status from the AWS Amplify Console for app: https://<branch>.<appId>.amplifyapp.com/. Go to https://console.aws.amazon.com/amplify/home?region=<region>#<appId>/<branch>/<jobId> to view details on your build. ",
"detail": "<status> build status from the AWS Amplify Console for app: https://<branch>.<appId>.amplifyapp.com/. Go to https://console.aws.amazon.com/amplify/home?region=<region>#<appId>/<branch>/<jobId> to view details on your build. ",
"source": <source>,
"account": <account>,
"time": <time>,
"region": <region>,
"resources": <resources>
}
Noting that that comment above should reference EventBridge rather than Event Grid
These "solutions" are all pretty horrible. The EventBridge thing requires doing it separately for each app that is deployed.
The Lambda thing looks ok, but why do I need to do that when Amplify is supposed to make things easy! Also, it doesn't use the AWS Chatbot service so I need to add and manage it separately(!)
Adding Amplify events to https://docs.aws.amazon.com/chatbot/latest/adminguide/related-services.html is what people want. A quick Google search shows the number of people who have posted random "solutions", all of which require more work on our part.
Any update on this feature? This is quite important and seems a lot of people are interested in it.
Hoping to get some updates on this feature
Me toooo!!
I really hope,.
This would be nice!
FYI: Workaround https://github.com/fossamagna/amplify-slack-bot
Is there any update? Very much needed feature. CodeBuild has it for ages!