Skip to content

Read-Only Attributes of SKE lead to re-apply for resource compliance #1078

@MrZep

Description

@MrZep

Description

When I create a SKE cluster using opentofu during a tofu apply and later will run another tofu apply, I will be informed that there are attributes (in this case the read-only attributes of the Master and Worker Node about the version) will be known after apply, which leads to unnecessary opentofu noise and unnecessary drifts + re-applys.

Image

Steps to reproduce

  1. Create a SKE Cluster in OpenTofu
  2. Apply
  3. Apply again
resource "stackit_ske_cluster" "this" {
  project_id             = stackit_resourcemanager_project.this.project_id
  name                   = "skepoc"
  kubernetes_version_min = "1.33.5"
  node_pools = [
    {
      name               = "worker-1"
      machine_type       = "g1a.2d"
      minimum            = 1
      maximum            = 1
      availability_zones = ["eu01-2"]
      os_name            = "flatcar"
      os_version_min     = "4230.2.4"
      volume_size        = 32
      volume_type        = "storage_premium_perf2"
    },
    {
      name               = "worker-2"
      machine_type       = "g1a.2d"
      minimum            = 1
      maximum            = 1
      availability_zones = ["eu01-2"]
      os_name            = "flatcar"
      os_version_min     = "4230.2.4"
      volume_size        = 32
      volume_type        = "storage_premium_perf2"
    }
  ]
  network = {
    id = stackit_network.this.network_id #Required for SKE Clusters in a SNA
  }
}

Actual behavior

The SKE Read-Only Attributes for the version are set to known after apply for every new apply after cluster creation.

Expected behavior

There shouldnt be chaning attribute noise.
Please describe the behavior which you would expect from the STACKIT Terraform provider in that case.

Environment

OpenTofu v1.9.0
on linux_amd64

  • provider registry.opentofu.org/gitlabhq/gitlab v18.3.0
  • provider registry.opentofu.org/stackitcloud/stackit v0.71.0

Additional information
Workaround in my case, but the issue should be resolved anyway.

  lifecycle {
    ignore_changes = [
      node_pools[0].os_version_used,
      node_pools[1].os_version_used,
      kubernetes_version_used
    ]
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions