Skip to content

Commit

Permalink
Terraform to set up slack integration (#98)
Browse files Browse the repository at this point in the history
This required some setup first:
 - Creating a Slack app with webhooks: https://api.slack.com/apps/A06KYD43DPE/incoming-webhooks?
 - Setting up a secret in Secret Manager in the cloud project with the webhook URL

This will post to a new Slack channel in transparency-dev called `cloudbuild-dev`, which I've created as a private group with me as the only member for testing.

When we're happy with this, we can deploy a prod version which posts to a public channel in the Slack channel.
  • Loading branch information
mhutchinson authored Feb 21, 2024
1 parent 3b56a27 commit 62bdaea
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
40 changes: 40 additions & 0 deletions deployment/live/cloudbuild/dev/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions deployment/modules/cloudbuild/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,18 @@ resource "google_project_iam_member" "cloudrun_deployer" {
member = "serviceAccount:${google_service_account.cloudbuild_service_account.email}"
}

module "cloud-build-slack-notifier" {
# This should be set back to the registry version when the following is merged:
# https://github.com/simplifi/terraform-google-cloud-build-slack-notifier/pull/8
source = "github.com/mhutchinson/terraform-google-cloud-build-slack-notifier"
# source = "simplifi/cloud-build-slack-notifier/google"
# version = "0.3.0"

name = "gcp-slack-notifier-${var.env}"
project_id = var.project_id

# https://api.slack.com/apps/A06KYD43DPE/incoming-webhooks
slack_webhook_url_secret_id = "gcb_slack_webhook_${var.env}"
slack_webhook_url_secret_project = var.project_id
}

0 comments on commit 62bdaea

Please sign in to comment.