# Creating Eventarc triggers with Terraform

Author: [Mete Atamel](https://atamel.dev/) | Published: 2022-03-18 | Updated: 2023-03-20 | Topics: Eventarc, Terraform, Serverless, Google Cloud Platform, How To | Canonical: https://cloud.google.com/blog/topics/developers-practitioners/creating-eventarc-triggers-terraform


Terraform is increasingly the preferred tool for building, changing, and versioning infrastructure in Google Cloud and across clouds. In an earlier post, I showed how to create Eventarc triggers using Google Cloud Console or via the command line with gcloud. In this post, I show how to create the same triggers with the google_eventarc_trigger Terraform resource. 

See eventarc-samples/terraform on GitHub for the prerequisites and main.tf for
full Terraform configuration. 

Define a Cloud Run service as an event sink
Before you can create a trigger, you need to create a Cloud Run service as an event sink for the trigger. You can use Terraform’s google_cloud_run_service resource to define a Cloud Run service: 


---
*Read the full article at [https://cloud.google.com/blog/topics/developers-practitioners/creating-eventarc-triggers-terraform](https://cloud.google.com/blog/topics/developers-practitioners/creating-eventarc-triggers-terraform)*
