Skip to content

feat(ske): support audit log configuration - #1578

Open
tobias-pfaffelmoser-ske wants to merge 8 commits into
stackitcloud:mainfrom
tobias-pfaffelmoser-ske:feat/ske-audit-logs
Open

feat(ske): support audit log configuration#1578
tobias-pfaffelmoser-ske wants to merge 8 commits into
stackitcloud:mainfrom
tobias-pfaffelmoser-ske:feat/ske-audit-logs

Conversation

@tobias-pfaffelmoser-ske

@tobias-pfaffelmoser-ske tobias-pfaffelmoser-ske commented Jul 10, 2026

Copy link
Copy Markdown

Description

Adds support for configuring SKE cluster audit log forwarding via a new optional
audit block on the stackit_ske_cluster resource (and as a read-only attribute
on the data source):

resource "stackit_ske_cluster" "example" {
  # ...
  audit = {
    enabled = true
  }
}

The audit.enabled flag is passed through to the SKE API (ske.Audit) on create/update and mapped back into state on read. This feature is in private preview and can only be enabled for accounts/projects that have been enabled for audit log forwarding to a Telemetry Router.

This also bumps the stackit-sdk-go/services/ske dependency to v1.19.0, which introduces the audit field.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@tobias-pfaffelmoser-ske
tobias-pfaffelmoser-ske requested a review from a team as a code owner July 10, 2026 12:41
Comment thread stackit/internal/services/ske/cluster/resource.go Outdated
Comment thread stackit/internal/services/ske/cluster/resource.go Outdated
}

func mapAudit(cl *ske.Cluster, m *Model) error {
// A missing audit block only occurs in regions where the feature is

@rubenhoenle rubenhoenle Jul 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully get this, can't the API just include false in the response in that case?

{
    ...
    "audit": {
        "enabled": false
    }
}

Else you might have users which will run into state drifts: When Terraform users set audit.enabled to false in their Terraform configuration, Terraform will also send false to the API. From my current understanding the API then just won't return the audit object at all in the response. This will lead to Terraform setting audit.enabled to null here which will then result in a state drift error.

@tobias-pfaffelmoser-ske tobias-pfaffelmoser-ske Jul 15, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Just checked with the team: when the feature is available in the respective region, the API always echoes the audit object back, including { "enabled": false }. So setting audit.enabled = false returns enabled: false and maps cleanly back into state - so no drift expected in this scenario.

When the feature is not available in the respective region, the API omits the audit object entirely. That is the situation where cl.Audit == nil, and in that case, audit shouldn't be configured on the cluster in the first place. Mapping it to null might make sense: if a user tries to configure audit in a region without the feature, the resulting diff could be the desired signal that the configuration has no effect at all. WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just curious, why would the feature be not available in a region at all? Don't we roll out the same service version to all regions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the resulting diff could be the desired signal that the configuration has no effect at all. WDYT?

And no, that's nothing we should aim for. State drifts are pain for our users and we shouldn't expose such problems to our users.... What brings me back to the question above 😉

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just curious, why would the feature be not available in a region at all? Don't we roll out the same service version to all regions?

e.g. in eu02 ske is rolled out but telemetry router/link is still WIP. This will be also the case for next regions

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As checked together with @MichaelEischer today:

  • SKE API change for audit log feature rolled out to all public regions -> API returns non-null audit object in any scenario
  • If audit feature generally not available/activated (at e.g. eu02), API also returns audit object with { "enabled": false }. However, sending { "enabled": true } to API results in returned error in respective region.

@rubenhoenle rubenhoenle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written in the PR template checklist, the Acceptance tests / E2E tests need to be adjusted to include your new field: ske_acc_test.go

Min test

In the min test only required fields must be set in the test configuration.

Since your field is optional you only have to add checks that the new field has the correct default value.

func TestAccSKEMin(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testutil.TestAccProtoV6ProviderFactories,
CheckDestroy: testAccCheckSKEDestroy,
Steps: []resource.TestStep{
// 1) Creation
{
Config: testutil.NewConfigBuilder().BuildProviderConfig() + "\n" + resourceMin,
ConfigVariables: testConfigVarsMin,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(testConfigVarsMin["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(testConfigVarsMin["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_name"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(testConfigVarsMin["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(testConfigVarsMin["region"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMin["network_control_plane_access_scope"])),
// Kubeconfig
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "project_id",
"stackit_ske_cluster.cluster", "project_id",
),
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "cluster_name",
"stackit_ske_cluster.cluster", "name",
),
// Access: resource-min does not define an access block, we expect idp: { enabled: false, type: stackit } here because of the default
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.enabled", "false"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
),
},
// 2) Data source
{
Config: resourceMin,
ConfigVariables: testConfigVarsMin,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "id", fmt.Sprintf("%s,%s,%s",
testutil.ConvertConfigVariable(testConfigVarsMin["project_id"]),
testutil.Region,
testutil.ConvertConfigVariable(testConfigVarsMin["name"]),
)),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_machine_type"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_maximum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_minimum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_name"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_end"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "region"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMin["network_control_plane_access_scope"])),
),
},
// 3) Import cluster
{
ResourceName: "stackit_ske_cluster.cluster",
ConfigVariables: testConfigVarsMin,
ImportStateIdFunc: func(s *terraform.State) (string, error) {
r, ok := s.RootModule().Resources["stackit_ske_cluster.cluster"]
if !ok {
return "", fmt.Errorf("couldn't find resource stackit_ske_cluster.cluster")
}
_, ok = r.Primary.Attributes["project_id"]
if !ok {
return "", fmt.Errorf("couldn't find attribute project_id")
}
name, ok := r.Primary.Attributes["name"]
if !ok {
return "", fmt.Errorf("couldn't find attribute name")
}
return fmt.Sprintf("%s,%s,%s", testutil.ProjectId, testutil.Region, name), nil
},
ImportState: true,
ImportStateVerify: true,
// The fields are not provided in the SKE API when disabled, although set actively.
ImportStateVerifyIgnore: []string{"kubernetes_version_min", "node_pools.0.os_version_min", "extensions.observability.%", "extensions.observability.instance_id", "extensions.observability.enabled"},
},
// 4) Update kubernetes version, OS version and maintenance end, downgrade of kubernetes version
{
Config: resourceMin,
ConfigVariables: configVarsMinUpdated(),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction("stackit_ske_cluster.cluster", plancheck.ResourceActionUpdate),
},
},
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(configVarsMinUpdated()["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(configVarsMinUpdated()["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_name"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(configVarsMinUpdated()["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(configVarsMinUpdated()["region"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(configVarsMinUpdated()["network_control_plane_access_scope"])),
// Kubeconfig
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "project_id",
"stackit_ske_cluster.cluster", "project_id",
),
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "cluster_name",
"stackit_ske_cluster.cluster", "name",
),
),
},
// Deletion is done by the framework implicitly
},
})
}

Max test

For the Max test you have to add your field to the Terraform config:

resource "stackit_ske_cluster" "cluster" {
project_id = var.project_id
name = var.name
node_pools = [{
availability_zones = [var.nodepool_availability_zone1]
machine_type = var.nodepool_machine_type
maximum = var.nodepool_maximum
minimum = var.nodepool_minimum
name = var.nodepool_name
allow_system_components = var.nodepool_allow_system_components
cri = var.nodepool_cri
labels = {
"label_key" = var.nodepool_label_value
}
max_surge = var.nodepool_max_surge
max_unavailable = var.nodepool_max_unavailable
os_name = var.nodepool_os_name
os_version_min = var.nodepool_os_version_min
taints = [{
effect = var.nodepool_taints_effect
key = var.nodepool_taints_key
value = var.nodepool_taints_value
}]
volume_size = var.nodepool_volume_size
volume_type = var.nodepool_volume_type
}
]
extensions = {
acl = {
enabled = var.ext_acl_enabled
allowed_cidrs = [var.ext_acl_allowed_cidr1]
}
observability = {
enabled = var.ext_observability_enabled
}
dns = {
enabled = var.ext_dns_enabled
zones = [stackit_dns_zone.dns-zone.dns_name]
}
}
hibernations = [{
start = var.nodepool_hibernations1_start
end = var.nodepool_hibernations1_end
timezone = var.nodepool_hibernations1_timezone
}]
kubernetes_version_min = var.kubernetes_version_min
maintenance = {
enable_kubernetes_version_updates = var.maintenance_enable_kubernetes_version_updates
enable_machine_image_version_updates = var.maintenance_enable_machine_image_version_updates
start = var.maintenance_start
end = var.maintenance_end
}
region = var.region
network = {
control_plane = {
access_scope = var.network_control_plane_access_scope
}
}
access = {
idp = {
enabled = var.access_idp_enabled
type = "stackit"
}
}
}

Afterwards add a new variable for your field:

var testConfigVarsMax = config.Variables{
"project_id": config.StringVariable(testutil.ProjectId),
"name": config.StringVariable(maxTestName),
"nodepool_availability_zone1": config.StringVariable(fmt.Sprintf("%s-1", testutil.Region)),
"nodepool_machine_type": config.StringVariable("g2i.2"),
"nodepool_minimum": config.StringVariable("1"),
"nodepool_maximum": config.StringVariable("2"),
"nodepool_name": config.StringVariable("np-acc-test"),
"nodepool_allow_system_components": config.StringVariable("true"),
"nodepool_cri": config.StringVariable("containerd"),
"nodepool_label_value": config.StringVariable("value"),
"nodepool_max_surge": config.StringVariable("1"),
"nodepool_max_unavailable": config.StringVariable("1"),
"nodepool_os_name": config.StringVariable(skeProviderOptions.nodePoolOsName),
"nodepool_os_version_min": config.StringVariable(skeProviderOptions.GetCreateMachineVersion()),
"nodepool_taints_effect": config.StringVariable("PreferNoSchedule"),
"nodepool_taints_key": config.StringVariable("tkey"),
"nodepool_taints_value": config.StringVariable("tvalue"),
"nodepool_volume_size": config.StringVariable("20"),
"nodepool_volume_type": config.StringVariable("storage_premium_perf0"),
"ext_acl_enabled": config.StringVariable("true"),
"ext_acl_allowed_cidr1": config.StringVariable("10.0.100.0/24"),
"ext_observability_enabled": config.StringVariable("false"),
"ext_dns_enabled": config.StringVariable("true"),
"nodepool_hibernations1_start": config.StringVariable("0 18 * * *"),
"nodepool_hibernations1_end": config.StringVariable("59 23 * * *"),
"nodepool_hibernations1_timezone": config.StringVariable("Europe/Berlin"),
"kubernetes_version_min": config.StringVariable(skeProviderOptions.GetCreateK8sVersion()),
"maintenance_enable_machine_image_version_updates": config.StringVariable("true"),
"maintenance_enable_kubernetes_version_updates": config.StringVariable("true"),
"maintenance_start": config.StringVariable("02:00:00+01:00"),
"maintenance_end": config.StringVariable("04:00:00+01:00"),
"region": config.StringVariable(testutil.Region),
"expiration": config.StringVariable("3600"),
"refresh": config.StringVariable("true"),
"refresh_before": config.StringVariable("600"),
"dns_zone_name": config.StringVariable("acc-" + acctest.RandStringFromCharSet(6, acctest.CharSetAlpha)),
"dns_name": config.StringVariable("acc-" + acctest.RandStringFromCharSet(6, acctest.CharSetAlpha) + ".runs.onstackit.cloud"),
"network_control_plane_access_scope": config.StringVariable("PUBLIC"),
"access_idp_enabled": config.BoolVariable(true),
}

Also update the field to test not only the create operation but also the update operation:

func configVarsMaxUpdated() config.Variables {
updatedConfig := maps.Clone(testConfigVarsMax)
updatedConfig["kubernetes_version_min"] = config.StringVariable(skeProviderOptions.GetUpdateK8sVersion())
updatedConfig["nodepool_os_version_min"] = config.StringVariable(skeProviderOptions.GetUpdateMachineVersion())
updatedConfig["maintenance_end"] = config.StringVariable("03:03:03+00:00")
updatedConfig["access_idp_enabled"] = config.BoolVariable(false)
return updatedConfig
}

Then add the checks for your new field to the text steps:

func TestAccSKEMax(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testutil.TestAccProtoV6ProviderFactories,
CheckDestroy: testAccCheckSKEDestroy,
Steps: []resource.TestStep{
// 1) Creation
{
Config: testutil.NewConfigBuilder().BuildProviderConfig() + "\n" + resourceMax,
ConfigVariables: testConfigVarsMax,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(testConfigVarsMax["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(testConfigVarsMax["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.allow_system_components", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_allow_system_components"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.cri", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_cri"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.labels.label_key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_label_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_surge", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_surge"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_unavailable", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_unavailable"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_os_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_version_min", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_os_version_min"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.effect", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_effect"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_key"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.value", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_size", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_size"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.0", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_allowed_cidr1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.observability.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_observability_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_dns_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["dns_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.start", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.end", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.timezone", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_timezone"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(testConfigVarsMax["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(testConfigVarsMax["region"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "egress_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "egress_address_ranges.0"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "pod_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "pod_address_ranges.0"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "service_account_issuer"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMax["network_control_plane_access_scope"])),
// Access
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["access_idp_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
// Kubeconfig
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "project_id",
"stackit_ske_cluster.cluster", "project_id",
),
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "cluster_name",
"stackit_ske_cluster.cluster", "name",
),
resource.TestCheckResourceAttr("stackit_ske_kubeconfig.kubeconfig", "expiration", testutil.ConvertConfigVariable(testConfigVarsMax["expiration"])),
resource.TestCheckResourceAttr("stackit_ske_kubeconfig.kubeconfig", "refresh", testutil.ConvertConfigVariable(testConfigVarsMax["refresh"])),
resource.TestCheckResourceAttr("stackit_ske_kubeconfig.kubeconfig", "refresh_before", testutil.ConvertConfigVariable(testConfigVarsMax["refresh_before"])),
resource.TestCheckResourceAttrSet("stackit_ske_kubeconfig.kubeconfig", "expires_at"),
),
},
// 2) Data source
{
Config: resourceMax,
ConfigVariables: testConfigVarsMax,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "id", fmt.Sprintf("%s,%s,%s",
testutil.ConvertConfigVariable(testConfigVarsMax["project_id"]),
testutil.Region,
testutil.ConvertConfigVariable(testConfigVarsMax["name"]),
)),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_machine_type"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_maximum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_minimum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_name"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.allow_system_components", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_allow_system_components"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.cri", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_cri"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.labels.label_key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_label_value"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.max_surge", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_surge"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.max_unavailable", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_unavailable"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.os_name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_os_name"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.0.effect", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_effect"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.0.key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_key"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.0.value", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_value"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.volume_size", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_size"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.volume_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_type"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.acl.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_enabled"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.0", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_allowed_cidr1"])),
// no check for observability, as it was disabled in the setup
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.dns.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_dns_enabled"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.dns.zones.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.dns.zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["dns_name"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.0.start", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_start"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.0.end", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_end"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.0.timezone", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_timezone"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_start"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_end"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(testConfigVarsMax["region"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "egress_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "egress_address_ranges.0"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "pod_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "pod_address_ranges.0"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMax["network_control_plane_access_scope"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "service_account_issuer"),
// Access
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "access.idp.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["access_idp_enabled"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
),
},
// 3) Import cluster
{
ResourceName: "stackit_ske_cluster.cluster",
ConfigVariables: testConfigVarsMax,
ImportStateIdFunc: func(s *terraform.State) (string, error) {
r, ok := s.RootModule().Resources["stackit_ske_cluster.cluster"]
if !ok {
return "", fmt.Errorf("couldn't find resource stackit_ske_cluster.cluster")
}
_, ok = r.Primary.Attributes["project_id"]
if !ok {
return "", fmt.Errorf("couldn't find attribute project_id")
}
name, ok := r.Primary.Attributes["name"]
if !ok {
return "", fmt.Errorf("couldn't find attribute name")
}
return fmt.Sprintf("%s,%s,%s", testutil.ProjectId, testutil.Region, name), nil
},
ImportState: true,
ImportStateVerify: true,
// The fields are not provided in the SKE API when disabled, although set actively.
ImportStateVerifyIgnore: []string{"kubernetes_version_min", "node_pools.0.os_version_min", "extensions.observability.%", "extensions.observability.instance_id", "extensions.observability.enabled"},
},
// 4) Update kubernetes version, OS version and maintenance end, downgrade of kubernetes version, set access.idp.enabled to false
{
Config: resourceMax,
ConfigVariables: configVarsMaxUpdated(),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction("stackit_ske_cluster.cluster", plancheck.ResourceActionUpdate),
},
},
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(configVarsMaxUpdated()["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(configVarsMaxUpdated()["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.allow_system_components", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_allow_system_components"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.cri", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_cri"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.labels.label_key", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_label_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_surge", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_max_surge"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_unavailable", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_max_unavailable"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_name", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_os_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_version_min", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_os_version_min"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.effect", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_taints_effect"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.key", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_taints_key"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.value", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_taints_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_size", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_volume_size"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_type", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_volume_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_acl_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.0", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_acl_allowed_cidr1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.observability.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_observability_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_dns_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.0", testutil.ConvertConfigVariable(configVarsMaxUpdated()["dns_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.start", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_hibernations1_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.end", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_hibernations1_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.timezone", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_hibernations1_timezone"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(configVarsMaxUpdated()["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(configVarsMaxUpdated()["region"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "egress_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "egress_address_ranges.0"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "pod_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "pod_address_ranges.0"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "service_account_issuer"),
// Access
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["access_idp_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
),
},
// Deletion is done by the framework implicitly
},
})
}

resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_end"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "region"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMin["network_control_plane_access_scope"])),

@rubenhoenle rubenhoenle Jul 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also check the output of the datasource here (min test)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(configVarsMinUpdated()["region"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(configVarsMinUpdated()["network_control_plane_access_scope"])),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also check it here after the update (min test)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@rubenhoenle rubenhoenle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good besides that ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants