Terraform Version
Terraform v1.5.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v4.77.0
Affected Resource(s)
Terraform Configuration Files
variable "gke_username" {
default = ""
description = "gke username"
}
variable "gke_password" {
default = ""
description = "gke password"
}
# GKE cluster
resource "google_container_cluster" "primary" {
name = "${var.project_id}-gke"
location = var.region
network = google_compute_network.vpc.name
subnetwork = google_compute_subnetwork.subnet.name
# Enabling Autopilot for this cluster
enable_autopilot = true
}
Expected Behavior
Terraform should not destroy my cluster when nothing has changed.
Actual Behavior
google_container_cluster.primary must be replaced
Terraform wants to destroy my cluster, even though I haven't changed a single line of Terraform code.
Steps to Reproduce
Please follow https://www.hashicorp.com/blog/terraform-adds-support-for-gke-autopilot after successfully provisioning all resources run terraform apply again.
Running terraform apply -refresh-only shows no changes.
References
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Terraform should not destroy my cluster when nothing has changed.
Actual Behavior
Terraform wants to destroy my cluster, even though I haven't changed a single line of Terraform code.
Steps to Reproduce
Please follow https://www.hashicorp.com/blog/terraform-adds-support-for-gke-autopilot after successfully provisioning all resources run
terraform applyagain.Running
terraform apply -refresh-onlyshows no changes.References