hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.32k stars 1.72k forks source link

google_alloydb_instance and google_alloydb_cluster is showing diff for update_time, annotations and labels #16470

Open imrannayer opened 11 months ago

imrannayer commented 11 months ago

Community Note

Terraform Version

Terraform v1.5.3
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v5.5.0
+ provider registry.terraform.io/hashicorp/google-beta v5.5.0

Affected Resource(s)

Terraform Configuration Files

Debug Output

Panic Output

resource "google_alloydb_cluster" "default" {
  provider   = google-beta
  cluster_id = "${var.prefix}-alloydb-cluster"
  location   = var.gcp_region
  project    = var.project_id
  network    = "projects/${var.project_id}/global/networks/${local.network_name}"

  initial_user {
    user     = "myuser"
    password = "myPassword1234"
  }

  depends_on = [
    google_service_networking_connection.vpc_connection
  ]
}

output "primary_cluster" {
  value = google_alloydb_cluster.default
}

resource "google_alloydb_instance" "default" {
  provider      = google-beta
  cluster       = google_alloydb_cluster.default.name
  instance_id   = "${var.prefix}-alloydb-instance"
  display_name  = "my-alloydb-instance"
  instance_type = "PRIMARY"
  machine_config {
    cpu_count = 4
  }

  database_flags = {
    "google_columnar_engine.scan_mode" = 2
  }

}

output "primary_instance" {
  value = google_alloydb_instance.default
}

Expected Behavior

It should not show diff

Actual Behavior

After deploying alloyDB instance when I execute terraform apply it shows diff for update_time. It is also showing diff for annotations and labels when we dont pass these fields.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

b/309935431

GauravJain21 commented 1 month ago

The issue is no longer observed. Closing the bug and marking it as obsolete.

GauravJain21 commented 1 month ago

@imrannayer Can you please close this bug? More details at b/309935431.