tencentcloudstack / terraform-provider-tencentcloud

Terraform Tencent Cloud Provider
https://www.terraform.io/docs/providers/tencentcloud/
Mozilla Public License 2.0
188 stars 132 forks source link

1.81.77 incompatibility/broken ? #2548

Closed sbfaulkner closed 5 months ago

sbfaulkner commented 5 months ago

Community Note

Terraform Version

broken

➜ terraform -v
Terraform v1.7.4
on darwin_arm64
+ provider registry.terraform.io/tencentcloudstack/tencentcloud v1.81.77

working

➜ terraform -v
Terraform v1.7.4
on darwin_arm64
+ provider registry.terraform.io/tencentcloudstack/tencentcloud v1.81.76

Affected Resource(s)

My reproduction specifically shows these resources as broken, but the issue appears to extend across many more...

Terraform Configuration Files

variable "tencent_secret_id" {
  description = "The Tencent access token"
}

variable "tencent_secret_key" {
  description = "The Tecent secret key"
}

terraform {
  required_providers {
    tencentcloud = {
      source  = "tencentcloudstack/tencentcloud"

      # working version
      # version = "1.81.76"

      # "broken" version
      version = "1.81.77"
    }
  }

  required_version = ">= 1.7"
}

provider "tencentcloud" {
  secret_id  = var.tencent_secret_id
  secret_key = var.tencent_secret_key
}

data "tencentcloud_images" "centos-7-5" {
  image_type = ["PUBLIC_IMAGE"]
  os_name    = "centos 7.5"
}

output "images" {
  value = data.tencentcloud_images.centos-7-5.images
}

Debug Output

Panic Output

Expected Behavior

➜ terraform plan
data.tencentcloud_images.centos-7-5: Reading...
data.tencentcloud_images.centos-7-5: Read complete after 4s [id=1419385772]

Changes to Outputs:
  + images = [
      + {
          + architecture       = "x86_64"
          + created_time       = ""
          + image_creator      = ""
          + image_description  = "CentOS 7.5 64bit"
          + image_id           = "img-oikl1tzv"
          + image_name         = "CentOS 7.5 64bit"
          + image_size         = 20
          + image_source       = "OFFICIAL"
          + image_state        = "NORMAL"
          + image_type         = "PUBLIC_IMAGE"
          + os_name            = "CentOS 7.5 64bit"
          + platform           = "CentOS"
          + snapshots          = []
          + support_cloud_init = true
          + sync_percent       = 0
        },
    ]

You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.

Actual Behavior

➜ terraform plan
data.tencentcloud_images.centos-7-5: Reading...

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: [TencentCloudSDKError] Code=InvalidParameter, Message=The value of parameter `ImageIds` is not valid, cannot be null., RequestId=87d30d05-ff5e-420d-a98e-4d39befd61df
│
│   with data.tencentcloud_images.centos-7-5,
│   on test.tf line 30, in data "tencentcloud_images" "centos-7-5":
│   30: data "tencentcloud_images" "centos-7-5" {
│
╵

Steps to Reproduce

  1. terraform plan using tencentcloudstack/tencentcloud v1.81.77
sbfaulkner commented 5 months ago

maybe related? https://github.com/TencentCloud/tencentcloud-sdk-go/pull/251

sesky4 commented 5 months ago

@sbfaulkner hi, thanks for submitting the issue.

maybe related? TencentCloud/tencentcloud-sdk-go#251

yes, that's the root cause, we are trying to fix it.

hellertang commented 5 months ago

We sincerely apologize for the introduction of this issue in version v1.71.87. We have rolled back the Provider's dependency on the tencent-sdk-go version. Please use the newly released, latest version v1.71.88.