Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
petersin0422 committed Jul 10, 2024
1 parent 7241b69 commit 1e2e293
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions cloudwatch-metric-alarm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
}
9 changes: 9 additions & 0 deletions route53-health-check.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1e2e293

Please sign in to comment.