Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tencentcloud_clb_target_group_instance_attachment create resource failed on v1.18.110 #2736

Open
troyqu opened this issue Jul 19, 2024 · 0 comments

Comments

@troyqu
Copy link

troyqu commented Jul 19, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

➜  03-instance git:(feat) ✗ tf -version             
Terraform v1.8.4
on darwin_amd64
+ provider registry.terraform.io/tencentcloudstack/tencentcloud v1.81.110

Your version of Terraform is out of date! The latest version
is 1.9.2. You can update by downloading from https://www.terraform.io/downloads.html
➜  03-instance git:(feat) ✗ 

Affected Resource(s)

  • tencentcloud_clb_instance

Terraform Configuration Files

tencentcloud_clb_target_group_instance_attachment resource hcl

resource "tencentcloud_clb_target_group_instance_attachment" "items" {
  #Required
  bind_ip = try(local.depend_resource[var.configData.bind_ip], var.configData.bind_ip)
  port = try(local.depend_resource[var.configData.port], var.configData.port)
  target_group_id = try(local.depend_resource[var.configData.target_group_id], var.configData.target_group_id)
  weight = var.configData.weight
}

below are the output of resource creating

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_instance["LB-xxx-website"].tencentcloud_clb_instance.items will be created
  + resource "tencentcloud_clb_instance" "items" {
      + address_ip_version           = (known after apply)
      + address_ipv6                 = (known after apply)
      + clb_name                     = "LB-xxx-website"
      + clb_vips                     = (known after apply)
      + delete_protect               = false
      + domain                       = (known after apply)
      + id                           = (known after apply)
      + internet_bandwidth_max_out   = 10
      + internet_charge_type         = "TRAFFIC_POSTPAID_BY_HOUR"
      + ipv6_mode                    = (known after apply)
      + load_balancer_pass_to_target = false
      + master_zone_id               = (known after apply)
      + network_type                 = "OPEN"
      + project_id                   = 0
      + sla_type                     = (known after apply)
      + slave_zone_id                = (known after apply)
      + tags                         = {
          + "env"         = "prod"
        }
      + target_region_info_region    = (known after apply)
      + target_region_info_vpc_id    = (known after apply)
      + vip                          = (known after apply)
      + vip_isp                      = (known after apply)
      + vpc_id                       = "vpc-ia7khsuc"
      + zone_id                      = (known after apply)
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_listener["LB-LSNR-www.xxx.com-443"].tencentcloud_clb_listener.items will be created
  + resource "tencentcloud_clb_listener" "items" {
      + clb_id                     = (known after apply)
      + end_port                   = (known after apply)
      + health_check_context_type  = (known after apply)
      + health_check_health_num    = 3
      + health_check_http_method   = (known after apply)
      + health_check_interval_time = 5
      + health_check_port          = 443
      + health_check_switch        = true
      + health_check_time_out      = 2
      + health_check_type          = "TCP"
      + health_check_unhealth_num  = 3
      + health_source_ip_type      = 1
      + id                         = (known after apply)
      + keepalive_enable           = (known after apply)
      + listener_id                = (known after apply)
      + listener_name              = "LB-LSNR-www.xxx.com-443"
      + port                       = 443
      + protocol                   = "TCP"
      + scheduler                  = "WRR"
      + session_type               = (known after apply)
      + target_type                = "NODE"
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_listener["LB-LSNR-www.xxx.com-80"].tencentcloud_clb_listener.items will be created
  + resource "tencentcloud_clb_listener" "items" {
      + clb_id                     = (known after apply)
      + end_port                   = (known after apply)
      + health_check_context_type  = (known after apply)
      + health_check_health_num    = 3
      + health_check_http_method   = (known after apply)
      + health_check_interval_time = 5
      + health_check_port          = 80
      + health_check_switch        = true
      + health_check_time_out      = 2
      + health_check_type          = "TCP"
      + health_check_unhealth_num  = 3
      + health_source_ip_type      = 1
      + id                         = (known after apply)
      + keepalive_enable           = (known after apply)
      + listener_id                = (known after apply)
      + listener_name              = "LB-LSNR-www.xxx.com-80"
      + port                       = 80
      + protocol                   = "TCP"
      + scheduler                  = "WRR"
      + session_type               = (known after apply)
      + target_type                = "NODE"
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group["LB-TG-www.xxx.com-443"].tencentcloud_clb_target_group.items will be created
  + resource "tencentcloud_clb_target_group" "items" {
      + id                = (known after apply)
      + port              = 443
      + target_group_name = "LB-TG-www.xxx.com-443"
      + vpc_id            = "vpc-ia7khsuc"
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group["LB-TG-www.xxx.com-80"].tencentcloud_clb_target_group.items will be created
  + resource "tencentcloud_clb_target_group" "items" {
      + id                = (known after apply)
      + port              = 80
      + target_group_name = "LB-TG-www.xxx.com-80"
      + vpc_id            = "vpc-ia7khsuc"
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group_attachment["LB-TGA-www.xxx.com-443"].tencentcloud_clb_target_group_attachment.items will be created
  + resource "tencentcloud_clb_target_group_attachment" "items" {
      + clb_id          = (known after apply)
      + id              = (known after apply)
      + listener_id     = (known after apply)
      + target_group_id = (known after apply)
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group_attachment["LB-TGA-www.xxx.com-80"].tencentcloud_clb_target_group_attachment.items will be created
  + resource "tencentcloud_clb_target_group_attachment" "items" {
      + clb_id          = (known after apply)
      + id              = (known after apply)
      + listener_id     = (known after apply)
      + target_group_id = (known after apply)
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group_instance_attachment["LB-TGIA-www.xxx.com-443"].tencentcloud_clb_target_group_instance_attachment.items will be created
  + resource "tencentcloud_clb_target_group_instance_attachment" "items" {
      + bind_ip         = "192.168.50.9"
      + id              = (known after apply)
      + port            = 443
      + target_group_id = (known after apply)
      + weight          = 10
    }

  # module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group_instance_attachment["LB-TGIA-www.xxx.com-80"].tencentcloud_clb_target_group_instance_attachment.items will be created
  + resource "tencentcloud_clb_target_group_instance_attachment" "items" {
      + bind_ip         = "192.168.50.9"
      + id              = (known after apply)
      + port            = 80
      + target_group_id = (known after apply)
      + weight          = 10
    }

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

Debug Output

Panic Output

module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group_instance_attachment["LB-TGIA-www.xxx.com-443"].tencentcloud_clb_target_group_instance_attachment.items: Creation complete after 5s [id=lbtg-js4riq1x#192.168.50.9#443]
╷
│ Error: [TencentCloudSDKError] Code=FailedOperation, Message=listenerId lbl-qizodntv not in targetgroup mode, RequestId=83d90d8c-5754-479e-87a2-6588e0be1880
│ 
│   with module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group_attachment["LB-TGA-www.xxx.com-80"].tencentcloud_clb_target_group_attachment.items,
│   on ../../../../../../terraform.cloudbase.modules/tencentcloud/tencentcloud_clb_target_group_attachment/main.tf line 30, in resource "tencentcloud_clb_target_group_attachment" "items":
│   30: resource "tencentcloud_clb_target_group_attachment" "items" {
│ 
╵
╷
│ Error: [TencentCloudSDKError] Code=FailedOperation, Message=listenerId lbl-ranbpxpp not in targetgroup mode, RequestId=fb0e14a6-8970-4542-9590-e0b71bea717a
│ 
│   with module.tencentcloud_clb_instance.module.tencentcloud_clb_target_group_attachment["LB-TGA-www.xxx.com-443"].tencentcloud_clb_target_group_attachment.items,
│   on ../../../../../../terraform.cloudbase.modules/tencentcloud/tencentcloud_clb_target_group_attachment/main.tf line 30, in resource "tencentcloud_clb_target_group_attachment" "items":
│   30: resource "tencentcloud_clb_target_group_attachment" "items" {
│ 

Expected Behavior

  1. lb resource created successfully
  2. no error output on console
  3. backend server is successfully bound to the load balancer

Actual Behavior

  1. lb resource created successfully
  2. error output on console
  3. backend server is not bound to the load balancer

Steps to Reproduce

  1. terraform apply

Important Factoids

References

https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/latest/docs/resources/clb_target_group_instance_attachment

  • #0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant