google cloud platform – How to create a google_arcevent_trigger for files uploaded to GCS in a specific path?
I’m trying to create a google_eventarc_trigger in a Terraform module to be notified when files are uploaded to a specific folder in my GCS bucket. However I couldn’t find a way to define the path pattern in Terraform. How could I do that? This is my
resource "google_eventarc_trigger" "report_file_created_trigger" {
name = "report-file-created-trigger"
location = var.location
service_account = var.eventarc_gcs_sa
matching_criteria {
attribute = "type"
value = "google.cloud.storage.object.v1.finalized"
}
matching_criteria {
attribute = "bucket"
value = var.file_bucket
}
destination {
cloud_run_service {
service = google_cloud_run_v2_service.confirm_report.name
region = var.location
}
}
}
I’ve tried to include other matching_criterias like name and subject, but Terraform raised the following error on both of them:
Error: Error updating Trigger: googleapi: Error 400: The request was invalid: invalid argument: event type google.cloud.storage.object.v1.finalized not supported: attribute name not found within event type
Read more here: Source link
