Skip to content

Commit

Permalink
fix: use SRE bot slack notifications (#1348)
Browse files Browse the repository at this point in the history
Update do use the SRE bot slack notification rather
than the TF module.
  • Loading branch information
patheard authored Jul 21, 2023
1 parent fe62548 commit d42c1cc
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions infrastructure/terragrunt/aws/alarms/sns_topic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ resource "aws_sns_topic" "alert_observe_us_east" {
#
resource "aws_sns_topic_subscription" "alert_warning" {
topic_arn = aws_sns_topic.alert_warning.arn
protocol = "lambda"
endpoint = module.notify_slack.lambda_arn
protocol = "https"
endpoint = var.slack_webhook_url
}

resource "aws_sns_topic_subscription" "alert_warning_us_east" {
provider = aws.us-east-1

topic_arn = aws_sns_topic.alert_warning_us_east.arn
protocol = "lambda"
endpoint = module.notify_slack.lambda_arn
protocol = "https"
endpoint = var.slack_webhook_url
}

#
Expand Down Expand Up @@ -111,22 +111,3 @@ data "aws_iam_policy_document" "sns_cloudwatch" {
}
}
}

#
# Lambda: post notifications to Slack
#
module "notify_slack" {
source = "github.com/cds-snc/terraform-modules//notify_slack?ref=v6.1.1"

function_name = "notify_slack"
project_name = "Articles: ${var.env}"
slack_webhook_url = var.slack_webhook_url

sns_topic_arns = [
aws_sns_topic.alert_warning.arn,
aws_sns_topic.alert_warning_us_east.arn
]

billing_tag_key = var.billing_tag_key
billing_tag_value = var.billing_tag_value
}

0 comments on commit d42c1cc

Please sign in to comment.