hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.18k forks source link

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

Open jaimeadm opened 9 months ago

jaimeadm commented 9 months ago

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

github-actions[bot] commented 9 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 8 months ago

Hey @jaimeadm πŸ‘‹ Thank you for taking the time to raise this! I couldn't quite tell from your example configuration, but is the health check being created in the us-east-1 region? While triaging this, I found a comment on an older issue that mentioned this as a requirement.

jaimeadm commented 8 months ago

Hello,

I am on us-east-1 and still not working.

Alan M O Silva Gerente de TI @.*** Fone: +55 11 3823-3500 Ramal: 3562 www.jaime.com.br

[cid:a7c830e2-aa23-44bb-9fbd-3d58829fc985]


De: Justin Retzolk @.> Enviado: quarta-feira, 13 de março de 2024 18:15 Para: hashicorp/terraform-provider-aws @.> Cc: Alan Silva @.>; Mention @.> Assunto: Re: [hashicorp/terraform-provider-aws] [Bug]: aws_route53_health_check does not attach CloudWatch alarm. (Issue #35579)

Hey @jaimeadmhttps://github.com/jaimeadm πŸ‘‹ Thank you for taking the time to raise this! I couldn't quite tell from your example configuration, but is the health check being created in the us-east-1 region? While triaging this, I found a comment on an older issuehttps://github.com/hashicorp/terraform-provider-aws/issues/712#issuecomment-329162134 that mentioned this as a requirement.

β€” Reply to this email directly, view it on GitHubhttps://github.com/hashicorp/terraform-provider-aws/issues/35579#issuecomment-1995845816, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD4MXKLAJSYTHKWJCKTAAYLYYC6VZAVCNFSM6AAAAABCS7U77SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJVHA2DKOBRGY. You are receiving this because you were mentioned.Message ID: @.***>