google_eventarc_trigger

The Eventarc Trigger resource

Example Usage - basic

resource "google_eventarc_trigger" "primary" {
    name = "name"
    location = "europe-west1"
    matching_criteria {
        attribute = "type"
        value = "google.cloud.pubsub.topic.v1.messagePublished"
    }
    destination {
        cloud_run_service {
            service = google_cloud_run_service.default.name
            region = "europe-west1"
        }
    }
    labels = {
        foo = "bar"
    }
}

resource "google_pubsub_topic" "foo" {
    name = "topic"
}

resource "google_cloud_run_service" "default" {
    name     = "eventarc-service"
    location = "europe-west1"

    metadata {
        namespace = "my-project-name"
    }

    template {
        spec {
            containers {
                image = "gcr.io/cloudrun/hello"
                ports {
                    container_port = 8080
                }
            }
            container_concurrency = 50
            timeout_seconds = 100
        }
    }

    traffic {
        percent         = 100
        latest_revision = true
    }
}

Argument Reference

The following arguments are supported:

The destination block supports:

The matching_criteria block supports:


Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

The cloud_run_service block supports:

The gke block supports:

The http_endpoint block supports:

The network_config block supports:

The transport block supports:

The pubsub block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Trigger can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Trigger using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/triggers/{{name}}"
  to = google_eventarc_trigger.default
}

When using the terraform import command, Trigger can be imported using one of the formats above. For example:

$ terraform import google_eventarc_trigger.default projects/{{project}}/locations/{{location}}/triggers/{{name}}
$ terraform import google_eventarc_trigger.default {{project}}/{{location}}/{{name}}
$ terraform import google_eventarc_trigger.default {{location}}/{{name}}