weixin_39571403
2021-01-12 13:49 阅读 15

aws_lb_target_group failed to enable health check

terraform version: 0.11.14 plugin version: 2.12.0 aws_lb_target_group failed to enable health check, but actually health check is working: image

code:


resource "aws_lb_target_group" "kubeingress_public" {
  name     = "whatever"
  port     = 80
  protocol = "HTTP"
  vpc_id   = "whatever"

  health_check {
    interval            = "whatever"
    path                = "whatever"
    port                = "whatever"
    healthy_threshold   = "whatever"
    unhealthy_threshold = "whatever"
    matcher             = "whatever"
  }

}

terraform apply:


Terraform will perform the following actions:

  ~ aws_lb_target_group.kubeingress_public
      health_check.0.enabled: "false" => "true"

  ~ aws_lb_target_group.kubeingress_public_api
      health_check.0.enabled: "false" => "true"


Plan: 0 to add, 2 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_lb_target_group.kubeingress_public: Modifying... (ID: xxx)
  health_check.0.enabled: "false" => "true"
aws_lb_target_group.kubeingress_public_api: Modifying... (ID: xxx)
  health_check.0.enabled: "false" => "true"
aws_lb_target_group.kubeingress_public_api: Modifications complete after 1s (ID: xxx)
aws_lb_target_group.kubeingress_public: Modifications complete after 1s (ID: xxx)

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

terraform apply again:


Terraform will perform the following actions:

  ~ aws_lb_target_group.kubeingress_public
      health_check.0.enabled: "false" => "true"

  ~ aws_lb_target_group.kubeingress_public_api
      health_check.0.enabled: "false" => "true"


Plan: 0 to add, 2 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value:

该提问来源于开源项目:hashicorp/terraform-provider-aws

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

7条回答 默认 最新

  • weixin_39963819 weixin_39963819 2021-01-12 13:49

    I believe I also just hit this one as well. Applies, modifications complete, health check appears in console but Terraform keeps reporting it as off.

    点赞 评论 复制链接分享
  • weixin_39618275 weixin_39618275 2021-01-12 13:49

    I got the same issue. Running apply repeatedly still shows the change

    
      ~ aws_lb_target_group.target_group_new
          health_check.0.enabled: "false" => "true"
    

    If I manually fix the .tfstate the next refresh breaks it again.

    An additional note is that the issue manifests itself only in China AWS (I tried Beijing region). US regions do not have this issue.

    点赞 评论 复制链接分享
  • weixin_39571403 weixin_39571403 2021-01-12 13:49

    I got the same issue. Running apply repeatedly still shows the change

    
      ~ aws_lb_target_group.target_group_new
          health_check.0.enabled: "false" => "true"
    

    If I manually fix the .tfstate the next refresh breaks it again.

    An additional note is that the issue manifests itself only in China AWS (I tried Beijing region). US regions does not have this issue.

    Confirm I'm using AWS China, I did not know global account will not hit this issue.

    点赞 评论 复制链接分享
  • weixin_39963819 weixin_39963819 2021-01-12 13:49

    Can also confirm I was using Beijing. Wonder what's different, but not the first weird thing I've run into in China.

    点赞 评论 复制链接分享
  • weixin_39819152 weixin_39819152 2021-01-12 13:49

    I also confirm that I have this issue, in Beijing. At each plan or a apply, the "enabled" value of the TG group heath check is detected as false, so there is always "3 to change". Explicitly specifying "enabled = true" doesn't change anything.

    Terraform v0.12.7 + provider.aws v2.26.0

    healthcheck

    [EDIT] After updating the AWS Provider to v.2.28, it worked fine. There are no more changes to be made on the plan of the apply.

    I ran this command to update the provider : terraform init -upgrade

    点赞 评论 复制链接分享
  • weixin_39571403 weixin_39571403 2021-01-12 13:49

    I also confirm that I have this issue, in Beijing. At each plan or a apply, the "enabled" value of the TG group heath check is detected as false, so there is always "3 to change". Explicitly specifying "enabled = true" doesn't change anything.

    Terraform v0.12.7

    • provider.aws v2.26.0

    healthcheck

    [EDIT] After updating the AWS Provider to v.2.28, it worked fine. There are no more changes to be made on the plan of the apply.

    I ran this command to update the provider : terraform init -upgrade

    I guess AWS China fixed their API issue maybe, now I have no issues by change nothing...

    点赞 评论 复制链接分享
  • weixin_39717598 weixin_39717598 2021-01-12 13:49

    I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

    If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

    点赞 评论 复制链接分享

相关推荐