Monitor your AWS CodeBuilds via Lambda and Slack

I recently setup AWS CodePipeline and CodeBuild to perform continuous integration and testing. The piece that was missing out of the box was build notifications. I want to know if my build passes or fails and what the errors are.

I was able to throw together a quick solution using AWS CloudWatch Events, Lambda, and Slack. Here’s how it works…

CloudWatch Events trigger a Lambda for all CodeBuild phases. The Lambda POST’s a message to a Slack web hook.