Skip to content

[Bug]: aws_route53_health_check does not attach CloudWatch alarm. #35579

@jaimeadm

Description

@jaimeadm

Terraform Core Version

1.3.7

AWS Provider Version

4.40.0

Affected Resource(s)

aws_route53_health_check

Expected Behavior

CloudWatch Alarm be attached to Route53 health check.

Actual Behavior

The cloudwatch_alarm_name parmeter doesn't show the alarm in AWS Console which has been configured.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_cloudwatch_metric_alarm" "foobar" {
  alarm_name          = "terraform-test-foobar5"
  comparison_operator = "GreaterThanOrEqualToThreshold"
  evaluation_periods  = "2"
  metric_name         = "CPUUtilization"
  namespace           = "AWS/EC2"
  period              = "120"
  statistic           = "Average"
  threshold           = "80"
  alarm_description   = "This metric monitors ec2 cpu utilization"
  tags = {
    Name        = "foobar"
    Description = "Monitor EC2 CPU"
  }
}

resource "aws_route53_health_check" "foo" {
  type                            = "CLOUDWATCH_METRIC"
  cloudwatch_alarm_name           = aws_cloudwatch_metric_alarm.foobar.alarm_name
  cloudwatch_alarm_region         = "us-east-1"
  insufficient_data_health_status = "Healthy"
  tags = {
    Name        = "foo"
    Description = "CloudWatch Metric Alarm"
  }
}

Steps to Reproduce

terraform init && terraform apply

Debug Output

no errors are showed.

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/cloudwatchIssues and PRs that pertain to the cloudwatch service.service/route53Issues and PRs that pertain to the route53 service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions