You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# default to using notify_arns unless a more specific action is specified.
alarm_actions = compact(coalescelist(var.alarm_actions, var.notify_arns))
ok_actions = compact(coalescelist(var.ok_actions, var.notify_arns))
insufficient_data_actions = compact(coalescelist(var.insufficient_data_actions, var.notify_arns))
This worked fine, until #18 was merged. This PR changed the default value of var.alarm_actions, var.ok_actions and var.insufficient_data_actions from [] to [""], giving coalescelist a significantly different behaviour.
According to the terraform docs, coalescelist takes any number of list arguments and returns the first one that isn't empty. However, it does not consider a list containing an empty string as an empty list:
terraform console:
coalescelist([], [""], ["test"])
[
"",
]
We would like to get "test" returned here, but in fact it returns the array containing an empty string.
Expected Behavior
I expect that when you set an ARN as notify_arns, and do not set alarm_actions, ok_actions and insufficient_data_actions, that the module still sets the alarms alarm_actions, ok_actions, and insufficient_data_actions to notify_arns.
Steps to Reproduce
Set an ARN as notify_arns, do not set alarm_actions, ok_actions and insufficient_data_actions. This module will create cloudwatch alarms without actions. If you pass the arn as alarm_actions, ok_actions and insufficient_data_actions, it will set the alarms.
Environment (please complete the following information):
Tried this module's latest version (0.15.0) with latest Terraform 0.13.7, 0.14.11, 0.15.5.
The text was updated successfully, but these errors were encountered:
Describe the Bug
This module exposes 4 different variables to set ARNs that the cloudwatch alarms will set as their actions:
notify_arns
alarm_actions
ok_actions
insufficient_data_actions
The idea being that when you only set
notify_arns
, it will set the other action arns for you, so you don't have to pass the same variable three times. This works using acoalescelist
on one of the actions, and thenotify_arn
, to get the arn it needs (https://github.com/cloudposse/terraform-aws-alb-target-group-cloudwatch-sns-alarms/blob/master/main.tf#L43)This worked fine, until #18 was merged. This PR changed the default value of
var.alarm_actions
,var.ok_actions
andvar.insufficient_data_actions
from[]
to[""]
, givingcoalescelist
a significantly different behaviour.According to the terraform docs, coalescelist takes any number of list arguments and returns the first one that isn't empty. However, it does not consider a list containing an empty string as an empty list:
terraform console
:We would like to get
"test"
returned here, but in fact it returns the array containing an empty string.Expected Behavior
I expect that when you set an ARN as
notify_arns
, and do not setalarm_actions
,ok_actions
andinsufficient_data_actions
, that the module still sets the alarmsalarm_actions
,ok_actions
, andinsufficient_data_actions
tonotify_arns
.Steps to Reproduce
Set an ARN as
notify_arns
, do not setalarm_actions
,ok_actions
andinsufficient_data_actions
. This module will create cloudwatch alarms without actions. If you pass the arn asalarm_actions
,ok_actions
andinsufficient_data_actions
, it will set the alarms.Environment (please complete the following information):
Tried this module's latest version (0.15.0) with latest Terraform 0.13.7, 0.14.11, 0.15.5.
The text was updated successfully, but these errors were encountered: