sbercloud-terraform / terraform-provider-sbercloud

Terraform SberCloud Provider
https://registry.terraform.io/providers/sbercloud-terraform/sbercloud/latest/docs
Mozilla Public License 2.0
34 stars 21 forks source link

Cluster CCE Does Not Recreate When Subnet CIDR Changes #332

Open Mobydack opened 5 days ago

Mobydack commented 5 days ago

Terraform and Provider Versions

Expected Behavior

The sbercloud_cce_cluster resource should detect the dependency on the updated subnet and recreate accordingly. Subnet deletion and recreation should not cause timeouts or conflicts.

Actual Behavior

When the sbercloud_vpc_subnet.k8s_staging_pods CIDR is changed, Terraform attempts to delete the subnet but fails because it is still in use by the CCE cluster.

This results in the following error:
│ Error: error deleting Subnet: timeout while waiting for state to become 'DELETED' (last state: 'ACTIVE', timeout: 10m0s)

Planned Resource Changes

    # other resources will be updated (for example, the ingress add-on), but not the CCE cluster
    #sbercloud_vpc_subnet.k8s_staging_pods must be replaced
-/+ resource "sbercloud_vpc_subnet" "k8s_staging_pods" {
      ~ cidr              = "10.0.2.0/22" -> "10.0.4.0/22" # forces replacement
      ~ gateway_ip        = "10.0.2.1" -> "10.0.4.1" # forces replacement
    }

Important Notes