Я не могу интегрировать Route53 HealthCheck с Cloudwatch Alarms, используя Terraform.
Я пробовал "HealthCheckId" в облачных аварийных сигналах, а также "cloudwatch-alarm-name" в разделе Healthcheck. Ни один, казалось, не работал. Все создается благодаря интеграции не работает.
Вот мой код:
resource "aws_sns_topic" "route53-healthcheck-sns" {
name = "route53-healthcheck"
provider = "aws.oregon"
provisioner "local-exec" {
command = "aws sns subscribe --topic-arn ${self.arn} --region us-west-2 --protocol email --notification-endpoint ${var.emails}"
}
}
resource "aws_route53_health_check" "r53_healthcheck" {
fqdn = "my.domain.com"
port = 443
type = "HTTPS"
resource_path = "/SalesPortal/#!/"
failure_threshold = "3"
request_interval = "30"
measure_latency = "1"
tags = {
Name = "r53_healthcheck"
}
}
resource "aws_cloudwatch_metric_alarm" "route53-healthcheck-alarm" {
alarm_name = "r53-alarm"
comparison_operator = "LessThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "HealthCheckStatus"
namespace = "AWS/Route53"
period = "60"
statistic = "Minimum"
threshold = "0"
alarm_description = "This metric monitor whether the server is down or not."
insufficient_data_actions = []
actions = ["${aws_sns_topic.route53-healthcheck-sns.arn}"]
dimensions {
HealthCheckId = "${aws_route53_health_check.r53_healthcheck.id}"
}
}