terraform-provider-stackit icon indicating copy to clipboard operation
terraform-provider-stackit copied to clipboard

SKE: Provider options as data source

Open hown3d opened this issue 4 months ago • 1 comments

Problem description

When setting Kubernetes versions in an SKE cluster you need to know which versions are supported by SKE. This is currently not doable in a terraform way by retrieving a list of supported versions.

Proposed solution

SKE has an endpoint /v2/regions/{region}/provider-options which can be used to retrieve the current supported versions. I would like to propose a new datasource for the terraform provider which uses this endpoint to select your kubernetes/machine-os versions or machine flavors. The datasource should be filterable. Some filter examples:

  • returning only supported kubernetes versions or machine
  • find machine types for a certain architecture (arm64, amd64)
  • find machine types with a certain amount of CPU and memory
  • find machine versions that are supported
data "stackit_ske_provider_options" "versions" {
  kubernetes_versions {
    versions_status = "supported"
  }
  machine_types {
    cpu = 8
    memory = 16
  }
}

resource "stackit_ske_cluster" "example" {
  kubernetes_version_min = data.stackit_ske_provider_options.versions.kubernetes_versions[0]
  node_pools = [
    {
      name = "np-example"
      machine_type = data.stackit_ske_provider_options.versions.machine_types[0]
      availability_zones = data.stackit_ske_provider_options.versions.availability_zones
    }
  ]
}

Additional information

Here are some examples from other cloud providers how they provide such a datasource in their terraform provider

  • AWS: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster_versions
  • GCP: https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/container_engine_versions

hown3d avatar Aug 13 '25 09:08 hown3d

Hi @hown3d, thank you for reporting this issue. We will have a look at it.

Fyusel avatar Aug 15 '25 09:08 Fyusel