Skip to content
Notify CodePipeline status changes such as STARTED, SUCCEEDED, FAILED, and so on to a Slack channel.
Rust HCL Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
docs
src
terraform
.gitignore
Cargo.toml
LICENSE
README.md

README.md

codepipeline-slack

Notify CodePipeline status changes such as STARTED, SUCCEEDED, FAILED, and so on to a Slack channel.

The repository includes a lambda function and a Terraform module, so it's easy to set up in your environment.

Example Slack messages

Overview

Overview

Prerequisite

  • Terraform 0.12
  • Docker

Set up

  1. Build the Lambda function
  2. Set up a Slack webhook URL to SSM parameter store
  3. Update your AWS environment with Terraform

Build the Lambda function

The following command builds the Lambda function in a Docker environment.

docker run --rm -v ${PWD}:/code -v \
  ${HOME}/.cargo/registry:/root/.cargo/registry -v \
  ${HOME}/.cargo/git:/root/.cargo/git softprops/lambda-rust

The zipped Lambda function will be at ./target/lambda/release/codepipeline-slack.zip.

Set up a Slack webhook URL to SSM parameter store

The Lambda function looks for a Slack's webhook URL from SSM parameter store. The parameter name can be configured by a Terraform variable.

name
/codepipeline-slack/webhook-url-ssm-param
value (SecureString is recommended)
https:....

Update your AWS environment with Terraform

First, copy terraform directory to your Terraform directory. And then add a module block to your Terraform configuration file:

module "codepipeline-slack" {
  source                          = "../modules/codepipeline-slack"
  slack_webhook_url_ssm_parameter = "/codepipeline-slack/webhook-url-ssm-param"
  lambda_zip_file                 = "lambda/codepipeline-slack.zip"
}
slack_webhook_url_ssm_parameter
The SSM parameter name which is configured in the previous section
lambda_zip_file
Path to the Lambda zip file

Now you can apply the configuration by terraform apply.

You can’t perform that action at this time.