hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

.node_config[0].gcfs_config: attribute representing nested block must not be unknown itself; set nested attribute values to unknown instead #20123

Open ericitaquera opened 1 month ago

ericitaquera commented 1 month ago

Community Note

Hello.

Even if explicitly "gcfs_config=enabled" in tf configuration, resulting GKE Cluster resource on GCP is created with "Image Streaming = Disabled".

Terraform Version & Provider Version(s)

Terraform v1.9.0 on linux_amd64

Affected Resource(s)

"google_container_cluster"

Terraform Configuration

resource "google_container_cluster" "main" {
 ...
  node_config {
    gcfs_config {
      enabled = true
    }
    ...
  }
...
}

Debug Output

No response

Expected Behavior

GKE cluster with Image Streaming enabled

Actual Behavior

Gke cluster with Image Streaming disabled

Steps to reproduce

  1. generate a tf with this configuration:
    resource "google_container_cluster" "main" {
    ...
    node_config {
    gcfs_config {
      enabled = true
    }
    ...
    }
    ...
    }
  2. terraform plan (check for gcfs_config)
  3. terraform apply
  4. Validate resource on GCP with Image Streaming disabled
  5. terraform plan (to check gcfs is drifted from configuration/actual resource/state)

Important Factoids

No response

References

No response

b/378481057

ggtisc commented 3 weeks ago

Confirmed issue!

After replicating the steps and using the following configuration as a basic example the value of gcfs_config.enabled in the tfstate file was false instead of true

resource "google_container_cluster" "container_cluster_20123" {
  name = "container-cluster-20123"
  location = "us-central1"
  initial_node_count = 1
  deletion_protection = false

  node_config {
    gcfs_config {
      enabled = true
    }
  }

  node_pool_auto_config {
    network_tags {
      tags = []
    }
  }
}