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

v1.18.108 tencentcloud_kubernetes_scale_worker created resource failed when count > 1 #2726

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

Comments

@troyqu
Copy link

troyqu commented Jul 16, 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

➜  anchnet-terraform-framwork-demo git:(feature_smartops) ✗ tf -v      
Terraform v1.8.4
on darwin_amd64

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
➜  anchnet-terraform-framwork-demo git:(feature_smartops) ✗ 

Affected Resource(s)

  • tencentcloud_kubernetes_scale_woker

Terraform Configuration Files

resource "tencentcloud_kubernetes_scale_worker" "items" {

  # required regular vars
  cluster_id = try(local.depend_resource[var.configData.cluster_id], var.configData.cluster_id)

  worker_config {
      count = var.configData.worker_config.count
      instance_type = var.configData.worker_config.instance_type
      subnet_id = try(local.depend_resource[var.configData.worker_config.subnet_id], var.configData.worker_config.subnet_id)
      availability_zone = var.configData.worker_config.availability_zone
      hostname = var.configData.worker_config.hostname
      img_id = var.configData.worker_config.img_id
      instance_charge_type = var.configData.worker_config.instance_charge_type
      instance_charge_type_prepaid_period = var.configData.worker_config.instance_charge_type_prepaid_period
      instance_charge_type_prepaid_renew_flag = var.configData.worker_config.instance_charge_type_prepaid_renew_flag
      instance_name = var.configData.worker_config.instance_name
      password = var.configData.worker_config.password
      security_group_ids = flatten([for k in var.configData.worker_config.security_group_ids : flatten([try(local.depend_resource[k], k)])])
      system_disk_size = var.configData.worker_config.system_disk_size
      system_disk_type = var.configData.worker_config.system_disk_type
  }
}

Debug Output

below are the output by plan & apply ⌘

terraform plan output: https://gist.github.com/troyqu/5f5312a1db7bd31d752e98c1d60c5b82
terraform apply output: https://gist.github.com/troyqu/977cafb44dc58f8b392bf3716193f15d

Panic Output

╷
│ Error: id is broken,cls-dpvb27uh#ins-gkvsm6ud#ins-7la52daf#ins-rjbve37x
│ 
│   with module.tencentcloud_kubernetes_cluster.module.tencentcloud_kubernetes_scale_worker["TKE-SW-1-TKE-SmartOps"].tencentcloud_kubernetes_scale_worker.items,
│   on ../../../../../../terraform.cloudbase.modules/tencentcloud/tencentcloud_kubernetes_scale_worker/main.tf line 34, in resource "tencentcloud_kubernetes_scale_worker" "items":
│   34: resource "tencentcloud_kubernetes_scale_worker" "items" {
│ 
╵
➜  

Expected Behavior

1.resource created success,no error in console output
2.resource can destroy by terraform destroy

Actual Behavior

1.resource created success,console output error
2.resource can not destroy by terraform destroy

Steps to Reproduce

  1. terraform apply

Important Factoids

1.after i tried such times on my local, i found if the count > 1 then the error will be hit. if count=1, then everything is fine.
2.i also checked the id in state file, the id field same as the output. id is "cls-dpvb27uh#ins-gkvsm6ud#ins-7la52daf#ins-rjbve37x"
image

References

https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.81.107/docs/resources/kubernetes_scale_worker#example-usage

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