Terraform: >= 1.8.0
ctrlplanedev/ctrlplane: ~> 1.11
The resource_selector attribute on ctrlplane_environment produces a diff on every terraform plan/terraform apply, even when no changes have been made. The API appears to normalize the selector string (collapsing multi-line values to a single line or stripping whitespace), but the provider does not normalize the value when reading state back, causing a perpetual mismatch.
resource "ctrlplane_environment" "clusters_eu_prod" {
name = "clusters-eu-prod"
description = "All EU Prod clusters"
resource_selector = <<-EOT
resource.kind == 'KubernetesCluster' &&
resource.metadata['geo-region'] == 'eu' &&
resource.metadata['stage'] == 'prod'
EOT
}
Every terraform plan shows a diff on resource_selector
The resource_selector attribute on ctrlplane_environment produces a diff on every terraform plan/terraform apply, even when no changes have been made. The API appears to normalize the selector string (collapsing multi-line values to a single line or stripping whitespace), but the provider does not normalize the value when reading state back, causing a perpetual mismatch.
Every terraform plan shows a diff on resource_selector