GoogleCloudPlatform/terraform-google-alloy-db

Permanent 'Note: Objects have changed outside of Terraform'

Closed this issue · 2 comments

When using the module, the primary instance is always showing as 'Objects have changed outside of Terraform' due to the update_time attribute on the instance.

Versions:
google provider v5.26.0
Terraform v1.8.4

module "alloydb" {
  source  = "GoogleCloudPlatform/alloy-db/google"
  version = "~> 2.0"

  project_id       = var.project_id
  cluster_id       = var.product
  cluster_location = "europe-west2"

  network_self_link = data.google_compute_network.default.id

  database_version = "POSTGRES_15"

  primary_instance = {
    instance_id = "primary"
    database_flags = {
      "alloydb.iam_authentication" = "on"
    }
    ssl_mode          = "ENCRYPTED_ONLY"
    machine_cpu_count = var.alloydb_cpu_count
    availability_type = var.alloydb_availability_type
    gce_zone          = var.alloydb_gce_zone
  }

  depends_on = [google_service_networking_connection.vpc_connection, google_compute_global_address.alloydb_private_ip_alloc]
  
}
Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the
last "terraform apply" which may have affected this plan:

  # module.chatbot_product.module.alloydb.google_alloydb_instance.primary has changed
  ~ resource "google_alloydb_instance" "primary" {
        id                    = "projects/my-project/locations/europe-west2/clusters/my-cluster/instances/primary"
        name                  = "projects/my-project/locations/europe-west2/clusters/my-cluster/instances/primary"
      ~ update_time           = "2024-05-30T14:05:05.6364540[19]Z" -> "2024-06-03T09:46:08.658064797Z"
        # (15 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

I can't seem to find any indication as to what is causing the update or what the update was. We can't ignore the attribute because the module wraps the creation of the resource.

@samsaam-thg this is provider issue. Can you plz create an issue for here on provider site.

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days