GoogleCloudPlatform / terraform-google-cloud-functions

Deploys Cloud Functions (Gen 2)
https://registry.terraform.io/modules/GoogleCloudPlatform/cloud-functions/google
Apache License 2.0
33 stars 27 forks source link

Cloud functions2 is getting updated everytime even if no changes done in the terraform code #64

Closed karan-sigmoid closed 1 year ago

karan-sigmoid commented 1 year ago

Terraform version - 1.4.5

provider version - 4.58.0

resource "google_storage_bucket" "storage_bucket_cloudfunctions" { project = name = location = "US" uniform_bucket_level_access = true force_destroy = var.force_destroy_flg encryption { default_kms_key_name = var.data_encryption_key

} }

resource "google_storage_bucket_object" "storage_bucket_object_cloudfunctions" { name = "index-cloudfunctions-cfs.zip" bucket = google_storage_bucket.storage_bucket_cloudfunctions.name source = "./modules/cfs/index-cloudfunctions-cfs.zip" kms_key_name = var.data_encryption_key depends_on = [google_storage_bucket.storage_bucket_cloudfunctions] }

resource "google_cloudfunctions2_function" "cfs_function_cloud" { name = "dataload_cloudfunction_cfs" location = "us-central1" description = project = build_config { runtime = "python311" entry_point = "main" # Set the entry point in the code
source { storage_source { bucket = google_storage_bucket.storage_bucket_cloudfunctions.name object = google_storage_bucket_object.storage_bucket_object_cloudfunctions.name } } } service_config { max_instance_count = 100 min_instance_count = 0 available_memory = "256M" timeout_seconds = 60 environment_variables = { GCP_PROJECT_ID = AIRFLOW_URI = var.airflow_uri } service_account_email = } event_trigger { trigger_region = "us-central1" event_type = "google.cloud.pubsub.topic.v1.messagePublished" retry_policy = "RETRY_POLICY_DO_NOT_RETRY" service_account_email = pubsub_topic = google_pubsub_topic.pubsub_topic.id }

}

terraform plan command updates the below ~ build_config {

(4 unchanged attributes hidden)

      ~ source {
          ~ storage_source {
              - generation = 1690270530751 -> null
                # (2 unchanged attributes hidden)
            }
        }
    }
dominique-lambert-OBS commented 1 year ago

Hello, we have the same problem with more recent versions (terraform and google provider) Terraform v1.5.3 on linux_amd64

jofrmartins commented 1 year ago

Hello, we also have the same problem, in every pull request appears a change in each cloud function.

karan-sigmoid commented 1 year ago

Hello, we also have the same problem, in every pull request appears a change in each cloud function.

may I know when the issue started?

jofrmartins commented 1 year ago

@karan-sigmoid last week.

jofrmartins commented 1 year ago

Here they suggest the following change (https://github.com/hashicorp/terraform-provider-google/issues/15249). But I am using google module, I can't do the ignore. It will have to be the module managers who add the ignore_changes.

github-actions[bot] commented 1 year ago

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