Amplify-console: Automatically Enable notifications for all connected branches

Created on 13 Jun 2019  路  8Comments  路  Source: aws-amplify/amplify-console

* Which Category is your question related to? *

Amplify Console

* What AWS Services are you utilizing? *

Auth/Storage/Console

I'm using amplify console as our CI/CD system but I'm having a hard time finding features in it that are available in other alternatives like CircleCI. My problem right now is trying to create a build complete/failed webhook for slack. It works ok for complete if I put it in frontend postBuild. But obviously if a step fails beforehand it never gets to that point.

So my question is how can I catch a build error and then run a bash command afterwards?

Thanks for looking into this!

feature request

Most helpful comment

@kmfreas I know this is late..but you can actually modify the event pattern that Amplify creates to notify your email about all branches (past, present, future) assuming you've created at least one notification via the Amplify console.

Go to the Amazon EventBridge console, under "Rules" find the rule for your app (should look like amplify---branch-notification). Modify the Event pattern by just deleting the "branches" array entirely (make sure to hit 'Update' at the bottom of the page after modifying the event pattern inline). You can quickly test by connecting a new branch.

This works b/c EventBridge treats a missing field as a wildcard, so by deleting the branches array you're telling the service to deliver events about all branches.

All 8 comments

Have you checked out the Email notification feature? It's actually an SNS topic which you can subscribe to. You can use that SNS topic to kickoff a Slack notification: https://medium.com/cohealo-engineering/how-set-up-a-slack-channel-to-be-an-aws-sns-subscriber-63b4d57ad3ea

Hey thanks for replying, I wasn't able to test this out until now. It works fine, however I can't figure out how to get it to work with all branches, especially future ones. Right now I have a lambda function using the aws-js-sdk to create the Amplify branches as they're pushed to github.

I'm using createBranch and it has an option for enableNotifications but that doesn't seem to do anything?

How do I get a newly created branch to send emails to my lambda arn?

Hey I just found this article here

Looks like there is a way to do it through cloudwatch?

https://medium.com/@dabit3/introducing-the-amplify-console-8-exciting-features-7e4075ff7b36

8: Notifications
Setup email notifications when your deployment succeeds or fails. Amplify Console submits build events to Amazon CloudWatch giving you a lot more capability to setup alarms and send events to services like Slack to notify users of changes.

@RyanHow yes you can, it just requires you to configure it. Check out https://github.com/aws-amplify/amplify-console/issues/13#issuecomment-502240507

@swaminator looks like that links back to this PR?

@swaminator have you discussed amplify console notification support with the AWS chatbot team? That would be great. 馃槉

@kmfreas I know this is late..but you can actually modify the event pattern that Amplify creates to notify your email about all branches (past, present, future) assuming you've created at least one notification via the Amplify console.

Go to the Amazon EventBridge console, under "Rules" find the rule for your app (should look like amplify---branch-notification). Modify the Event pattern by just deleting the "branches" array entirely (make sure to hit 'Update' at the bottom of the page after modifying the event pattern inline). You can quickly test by connecting a new branch.

This works b/c EventBridge treats a missing field as a wildcard, so by deleting the branches array you're telling the service to deliver events about all branches.

@mwarkentin @kmfreas @RyanHow this feature is now available in the Console

Was this page helpful?
0 / 5 - 0 ratings