From 1e2e2933c1ec59b165c8129c20c7607a8c9dba93 Mon Sep 17 00:00:00 2001 From: Peter Sin Date: Wed, 10 Jul 2024 10:07:22 -0700 Subject: [PATCH] minor fixes --- cloudwatch-metric-alarm.tf | 5 +---- route53-health-check.tf | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cloudwatch-metric-alarm.tf b/cloudwatch-metric-alarm.tf index 675369a..1adb213 100644 --- a/cloudwatch-metric-alarm.tf +++ b/cloudwatch-metric-alarm.tf @@ -21,9 +21,6 @@ locals { } } -# TODOs -# - Prefix Default Alarm name -# - Define alarm description resource "aws_cloudwatch_metric_alarm" "health_check_cloudwatch_alarms" { count = length(local.cloudwatch_alarms) @@ -36,7 +33,7 @@ resource "aws_cloudwatch_metric_alarm" "health_check_cloudwatch_alarms" { statistic = split(" ", local.cloudwatch_alarms[count.index].expression)[0] threshold = split(" ", local.cloudwatch_alarms[count.index].expression)[2] alarm_actions = local.cloudwatch_alarms[count.index].notification_sns_topic != null ? [local.cloudwatch_alarms[count.index].notification_sns_topic] : null - alarm_description = null # TODOs + alarm_description = null dimensions = { HealthCheckId = aws_route53_health_check.health_checks[local.cloudwatch_alarms[count.index].record_name].id } ok_actions = local.cloudwatch_alarms[count.index].notification_sns_topic != null ? [local.cloudwatch_alarms[count.index].notification_sns_topic] : null } diff --git a/route53-health-check.tf b/route53-health-check.tf index f64eb83..b64ebf0 100644 --- a/route53-health-check.tf +++ b/route53-health-check.tf @@ -84,6 +84,15 @@ resource "aws_route53_health_check" "health_checks" { each.value.endpoint_check_search_string != null ? "${each.value.endpoint_check_protocol}_STR_MATCH" : each.value.endpoint_check_protocol ) : each.value.is_calculated_check ? "CALCULATED" : "CLOUDWATCH_METRIC" + tags = merge( + { + "hosted-zone" = var.domain_name + "record" = each.key + }, + local.common_tags, + var.additional_tags_all + ) + disabled = !each.value.enabled invert_healthcheck = each.value.invert_health_check_status