Anda dapat membuat pemicu Eventarc yang memungkinkan fungsi Cloud Run
dipicu oleh peristiwa yang didukung oleh Eventarc. Perhatikan bahwa Anda harus mengonfigurasi pemicu saat membuat atau men-deploy fungsi menggunakan Google Cloud CLI atau konsol Google Cloud .
Anda juga dapat memicu fungsi Cloud Run sebagai respons terhadap peristiwa kustom yang dipublikasikan ke saluran Eventarc.
Membuat pemicu Eventarc
Buat pemicu Eventarc sehingga layanan fungsi Cloud Run Anda menerima notifikasi mengenai peristiwa atau rangkaian peristiwa tertentu. Dengan menentukan filter untuk pemicu, Anda dapat mengonfigurasi
pemilihan rute peristiwa, termasuk jenis dan sumber peristiwa. Untuk mengetahui informasi selengkapnya
tentang cara mengonfigurasi pemicu Eventarc untuk
Cloud Run Functions, lihat Pemicu Eventarc.
Jenis peristiwa berikut memicu permintaan ke layanan Anda:
Anda dapat memicu fungsi Cloud Run sebagai respons terhadap peristiwa kustom.
Peristiwa kustom yang dimaksud adalah yang dihasilkan oleh penyedia peristiwa khusus atau tambahan, bukan peristiwa Firebase bawaan yang didukung oleh Firebase SDK untuk fungsi Cloud Run, dan yang dipublikasikan ke saluran Eventarc. Untuk mengetahui informasi selengkapnya, lihat
Membuat dan menangani pemicu peristiwa kustom.
Perhatikan bahwa untuk peristiwa kustom yang disediakan oleh
Ekstensi Firebase,
Anda harus melihat dokumentasi ekstensi untuk mengetahui daftar peristiwa (jika ada)
yang dipublikasikan. Misalnya, lihat
jenis peristiwa untuk ekstensi Menjalankan Pembayaran dengan Stripe.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-18 UTC."],[[["\u003cp\u003eEventarc triggers enable Cloud Run functions to be activated by various events, requiring trigger configuration during function creation or deployment.\u003c/p\u003e\n"],["\u003cp\u003eCloud Run functions can be triggered by events such as audit log creation, direct events from sources like Cloud Storage, or messages published to a Pub/Sub topic.\u003c/p\u003e\n"],["\u003cp\u003eCustom events published to an Eventarc channel can also trigger Cloud Run functions, offering flexibility beyond built-in Firebase events.\u003c/p\u003e\n"],["\u003cp\u003eSpecific events are able to trigger requests to the Cloud Run service by configuring the filters of the trigger to match the criteria of the events.\u003c/p\u003e\n"]]],[],null,["# Create a trigger for Cloud Run functions\n\n[Standard](/eventarc/standard/docs/overview)\n\nYou can create an Eventarc trigger that enables a Cloud Run function\nto be triggered by an event supported by Eventarc. Note that you\nmust configure a trigger when you create or deploy a function using the\nGoogle Cloud CLI or the Google Cloud console.\n\nYou can also trigger Cloud Run functions in response to custom events\npublished to an Eventarc channel.\n\nCreate an Eventarc trigger\n--------------------------\n\nCreate an Eventarc trigger so that your\nCloud Run functions service receives notifications of a specific event or\nset of events. By specifying filters for the trigger, you can configure the\nrouting of the event, including the event type and source. For more information\non how to configure an Eventarc trigger for\nCloud Run functions, see [Eventarc triggers](/functions/docs/calling/eventarc).\n\nThe following event types trigger requests to your service:\n\n- [An audit log is created](/eventarc/docs/reference/supported-events#using-cloud-audit-logs) that matches the trigger's filter criteria\n- [A direct event occurs](/eventarc/docs/reference/supported-events#directly-from-a-google-cloud-source) such as an update to a Cloud Storage bucket or an update to a Firebase Remote Config template\n- [A message is published to a Pub/Sub topic](/eventarc/docs/reference/supported-events#using-pubsub)\n\nTrigger functions with custom events\n------------------------------------\n\nYou can trigger Cloud Run functions in response to custom events.\nThese are events produced by special or additional event providers, as opposed\nto the built-in Firebase events supported by the Firebase SDK for\nCloud Run functions, and that are published to an Eventarc\nchannel. For more information, see\n[Create and handle custom event triggers](https://firebase.google.com/docs/functions/beta/custom-events).\nNote that for custom events provided by\n[Firebase Extensions](https://firebase.google.com/docs/extensions/install-extensions),\nyou should refer to the extension's documentation for a list of events (if any)\nthat it publishes. For example, see the\n[event types for the Run Payments with Stripe extension](https://github.com/stripe/stripe-firebase-extensions/blob/98c97775d54fb0be4601864b74d2fe5ce24dab83/firestore-stripe-payments/extension.yaml)."]]