-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathslack.tf
More file actions
23 lines (20 loc) · 765 Bytes
/
slack.tf
File metadata and controls
23 lines (20 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
locals {
slack_username = coalesce(var.slack_username, local.account_id)
}
# The provider will compute sns_topic_name implicitly. Since you can't
# set depends_on in a module, the `aws_arn` object forces the object
# graph to complete before attempting to compute `aws_sns_topic.notify.name`.
data "aws_arn" "notify" {
arn = aws_sns_topic.notify.arn
}
module "notify_slack" {
source = "terraform-aws-modules/notify-slack/aws"
version = "~> 7.1.1"
create_sns_topic = false
lambda_function_name = "${var.name}-notify-slack"
sns_topic_name = data.aws_arn.notify.resource
slack_webhook_url = var.notify_webhook
slack_channel = var.slack_channel
slack_username = local.slack_username
tags = var.tags
}