Skip to content

AWS Lambda Serverless app to send AWS CodeBuild notifications to Slack

License

Notifications You must be signed in to change notification settings

khilnani/codebuild.slacker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codebuild.slacker

AWS Lambda Serverless app to send AWS CodeBuild notifications to Slack

This is an AWS Lambda Serverless app that can be used to respond to AWS Cloudwatch events from AWS CodeBuild by sending messages to Slack

Instructions

AWS CodeBuild

Create a Slack Webhook

You need to set this up for each AWS CodeBuild project & Slack Channel combination

  • Log into your Slack workspace online
  • Navigate to https://my.slack.com/services/new/incoming-webhook/
  • Select the Channel to post notifications to. e.g. dev-pipeline-events
  • Customize the Integration name. e.g. AWS CodeBuild - PROJECT_NAME
  • Use the Webhook URL from the next screen to update the config.json file.

Setup the Serverless App

  • Update the project name in package.json
  • Rename config.sample.json to config.json
  • Update the default project's AWS CodeBuild Project name and Slack Webhook
  • Update project-name in the fixtures/**.json files to match
  • Add more than one item if needed

Deploy the Serverless App

  • npm install - Installs Serverless and other dependencies locally
  • npm run deploy - Use NPX to deploy to AWS
  • npx run info - Print the Serverless Stack info
  • npm run logs - Tail CloudWatch Logs from AWS
  • npm run test-build - Run the Lambda locally using a Build json event
  • npm run test-phase - Run the Lambda locally using a Phase json event

Test the Serverless App

  • Run a AWS CodeBuild build and look for the Slack alert!

Reference Links

Releases

No releases published

Packages

No packages published