I am trying to write a custom module to deploy google cloud function gen2. however the problem I am facing is. there are lots even_types and based on even_type the event_trigger block changes.
ref:
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function
for pub/sub message publish
event_trigger {
trigger_region = "us-central1"
event_type = "google.cloud.pubsub.topic.v1.messagePublished"
pubsub_topic = google_pubsub_topic.topic.id
retry_policy = "RETRY_POLICY_RETRY"
}
and for cloud storage event
event_trigger {
event_type = "google.cloud.storage.object.v1.finalized"
retry_policy = "RETRY_POLICY_RETRY"
service_account_email = google_service_account.account.email
event_filters {
attribute = "bucket"
value = google_storage_bucket.trigger-bucket.name
}
}
and for http trigger. there won’t be any event_trigger block as variable of type map ?