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.75k stars 9.1k forks source link

Target group health check does not get updated #12832

Open rseuchter opened 4 years ago

rseuchter commented 4 years ago

Community Note

Terraform Version

Terraform v0.12.24
+ provider.aws v2.57.0

Affected Resource(s)

Terraform Configuration Files

data "aws_vpc" "main" {
  tags = {
    Name = "my-vpc"
  }
}

resource "aws_lb_target_group" "demo" {
  name     = "demo"
  port     = 42
  protocol = "TCP_UDP"
  vpc_id   = data.aws_vpc.main.id

  health_check {
    protocol = "TCP"
    port     = 42
    interval = 10
  }
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Terraform should modify (or if absolutely necessary destroy and re-create) a health check when setting interval from 10 to 30 or vice versa.

Actual Behavior

Terraform plan suggests an in-place update when going from 10 to 30 (or vice versa). A subsequent apply suggests:

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

However, the target group is not updated. (Fun fact: It cannot be updated through the console either.)

While the API documentation of ModifyTargetGroup says about HealthCheckIntervalSeconds that "With Network Load Balancers, you can't modify this setting." there isn't even a load balancer to begin with.

Steps to Reproduce

  1. terraform apply
  2. Modify the interval argument to 30
  3. terraform apply
  4. again and again

Important Factoids

N/A

References

Similar to

deepakcpakhale06 commented 3 years ago

I am also facing this issue. Terraform does not seem to pick up the changes in the health_check block

kaplanben commented 3 years ago

Hey, we also saw the same issue with NLB and UDP listener while changing target group health check params using version 3.42.0. Any update on this?

allan-simon commented 3 years ago

same issue here with 3.55.0 , we had a healthcheck block, we removed it from terraform , but terraform does not remove it

ei-grad commented 1 year ago

same issue here with 3.55.0 , we had a healthcheck block, we removed it from terraform , but terraform does not remove it

Same for me on 4.55.0. I think we should report it as a separate issue, because it is hard to find this one (as it is not exactly the same and not sounds definitely related).

It is currently impossible to expose functionality to enable/disable health_check for a module.

kenroydhs commented 7 months ago

Similar issue for v5.30. If I set "health_check" block in "aws_lb_target_group" and run apply then it is applied, but when I delete that "health_check" code block in "aws_lb_target_group", apply shows "no changes".