diff --git a/example/main.tf b/example/main.tf index 0185571..538e999 100644 --- a/example/main.tf +++ b/example/main.tf @@ -5,12 +5,18 @@ module "cloudwatch-monitor" { current_environment = "dev" template_data = { rediscluster = {} - websocketmonitoring = module.websocketmonitoring # + websocketmonitoring = module.websocketmonitoring } alarm_actions = { default = { - alarm = "" - ok = "" + alarm = { + critical = ["arn:aws:sns:us-east-1:123456789012:critical"] + warning = ["arn:aws:sns:us-east-1:123456789012:critical"] + } + ok = { + critical = ["arn:aws:sns:us-east-1:123456789012:critical"] + warning = ["arn:aws:sns:us-east-1:123456789012:critical"] + } } } } diff --git a/main.tf b/main.tf index 930479e..ebcba9d 100644 --- a/main.tf +++ b/main.tf @@ -83,16 +83,16 @@ module "metric-alarm" { actions_enabled = can(each.value.Config.AlarmActions) ? true : false alarm_actions = [for aK, aV in each.value.Config.AlarmActions.ALARM : - try(var.alarm_actions[aK]["alarm"][aV[var.current_environment]].arn, "") - if can(var.alarm_actions[aK]["alarm"][aV[var.current_environment]].arn) + try(var.alarm_actions[aK]["alarm"][aV[var.current_environment]], "") + if can(var.alarm_actions[aK]["alarm"][aV[var.current_environment]]) ] ok_actions = [for aK, aV in each.value.Config.AlarmActions.OK : - try(var.alarm_actions[aK]["ok"][aV[var.current_environment]].arn, "") - if can(var.alarm_actions[aK]["ok"][aV[var.current_environment]].arn) + try(var.alarm_actions[aK]["ok"][aV[var.current_environment]], "") + if can(var.alarm_actions[aK]["ok"][aV[var.current_environment]]) ] depends_on = [ module.log-metric-filter ] - + } #CloudWatch Custom Metrics