amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

Add notification integration with AWS chatbot

Open kkesley-shine opened this issue 6 years ago • 9 comments

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.

kkesley-shine avatar Nov 25 '19 23:11 kkesley-shine

I'm also very interested in this feature

jimmyn avatar Mar 04 '21 13:03 jimmyn

Duplicate of #943

jimmyn avatar Mar 19 '21 14:03 jimmyn

@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?

swaminator avatar Apr 16 '21 12:04 swaminator

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

mwarkentin avatar Apr 16 '21 13:04 mwarkentin

@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.

mwarkentin avatar Apr 16 '21 13:04 mwarkentin

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>
}

Derrickbowen avatar Jun 23 '21 13:06 Derrickbowen

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.

nick-verida avatar Nov 03 '21 01:11 nick-verida

Any update on this feature? This is quite important and seems a lot of people are interested in it.

jimmyn avatar Jul 09 '22 17:07 jimmyn

Hoping to get some updates on this feature

johnolatubosun avatar Sep 01 '22 17:09 johnolatubosun

Me toooo!!

Hibagon1go avatar Nov 26 '22 02:11 Hibagon1go

I really hope,.

naoyahieda avatar Nov 26 '22 02:11 naoyahieda

This would be nice!

dejavoodooo avatar Jan 13 '23 18:01 dejavoodooo

FYI: Workaround https://github.com/fossamagna/amplify-slack-bot

fossamagna avatar Feb 09 '23 02:02 fossamagna

Is there any update? Very much needed feature. CodeBuild has it for ages!

jimmyn avatar May 17 '23 17:05 jimmyn