Skip to content

Commit 95dfb82

Browse files
committed
handle the fact that nonsensitive will fail on empty list
Signed-off-by: Andrey Devyatkin <[email protected]>
1 parent 3bf4830 commit 95dfb82

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,12 @@ resource "aws_cloudwatch_event_target" "target" {
4747
}
4848

4949
locals {
50-
hook_urls = concat([nonsensitive(var.slack_hook_url)], nonsensitive(var.additional_slack_hook_urls))
50+
hook_urls = concat([nonsensitive(var.slack_hook_url)], local.additional_slack_hook_urls)
51+
}
52+
53+
# nonsensitive fails on empty list like this
54+
# Invalid value for "value" parameter: the given value is not sensitive, so this call is redundant.
55+
# thus have to do this
56+
locals {
57+
additional_slack_hook_urls = length(var.additional_slack_hook_urls) != 0 ? nonsensitive(var.additional_slack_hook_urls) : var.additional_slack_hook_urls
5158
}

0 commit comments

Comments
 (0)