ionos-cloud/terraform-provider-ionoscloud

Removing s3_buckets in k8s_cluster does not get noticed

henninge opened this issue · 2 comments

Description

Removing an s3_buckets block from an ionoscloud_k8s_cluster resource does not trigger a change.

Only an empty s3_buckets block will trigger a change.

Expected behavior

Removing the s3_buckets block should trigger a change, removing the bucket configuration from the cluster.

Environment

Terraform, provider version, os:

$ terraform version
Terraform v1.3.3
on darwin_amd64
+ provider registry.terraform.io/ionos-cloud/ionoscloud v6.3.2

Configuration Files

terraform {
  required_version = "1.3.3"
  required_providers {
    ionoscloud = {
      source  = "ionos-cloud/ionoscloud"
      version = "6.3.2"
    }
  }
}

resource "ionoscloud_k8s_cluster" "this" {
  name        = "testing-the-s3-buckets"
  k8s_version = "1.23.9"

  s3_buckets {
    name = "my-audit-logs-bucket"
  }
}

How to Reproduce

  1. In DCD create a bucket and put its name in the s3_buckets block.
  2. TF-apply the config using the same credentials.
  3. Remove/comment out the s3_buckets block.
  4. TF-plan the config -> NO changes detected.
  5. Remove/comment out just the content of the s3_buckets block.
  6. TF-plan the config -> removal is detected.

Additional Notes

I have no experience writing TF providers but the relevant code might be after this line.
https://github.com/ionos-cloud/terraform-provider-ionoscloud/blob/master/ionoscloud/resource_k8s_cluster.go#L341

Thanks, we'll take a look at it.

Hello, I fixed the issue and it will be available with the new 6.3.3 terraform ionoscloud provider verion release