Trigger

class Trigger : KotlinCustomResource

The Eventarc Trigger resource

Example Usage

Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudrun.Service;
import com.pulumi.gcp.cloudrun.ServiceArgs;
import com.pulumi.gcp.cloudrun.inputs.ServiceMetadataArgs;
import com.pulumi.gcp.cloudrun.inputs.ServiceTemplateArgs;
import com.pulumi.gcp.cloudrun.inputs.ServiceTemplateSpecArgs;
import com.pulumi.gcp.cloudrun.inputs.ServiceTrafficArgs;
import com.pulumi.gcp.eventarc.Trigger;
import com.pulumi.gcp.eventarc.TriggerArgs;
import com.pulumi.gcp.eventarc.inputs.TriggerMatchingCriteriaArgs;
import com.pulumi.gcp.eventarc.inputs.TriggerDestinationArgs;
import com.pulumi.gcp.eventarc.inputs.TriggerDestinationCloudRunServiceArgs;
import com.pulumi.gcp.pubsub.Topic;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new Service("default", ServiceArgs.builder()
.location("europe-west1")
.metadata(ServiceMetadataArgs.builder()
.namespace("my-project-name")
.build())
.template(ServiceTemplateArgs.builder()
.spec(ServiceTemplateSpecArgs.builder()
.containers(ServiceTemplateSpecContainerArgs.builder()
.image("gcr.io/cloudrun/hello")
.ports(ServiceTemplateSpecContainerPortArgs.builder()
.containerPort(8080)
.build())
.build())
.containerConcurrency(50)
.timeoutSeconds(100)
.build())
.build())
.traffics(ServiceTrafficArgs.builder()
.percent(100)
.latestRevision(true)
.build())
.build());
var primary = new Trigger("primary", TriggerArgs.builder()
.location("europe-west1")
.matchingCriterias(TriggerMatchingCriteriaArgs.builder()
.attribute("type")
.value("google.cloud.pubsub.topic.v1.messagePublished")
.build())
.destination(TriggerDestinationArgs.builder()
.cloudRunService(TriggerDestinationCloudRunServiceArgs.builder()
.service(default_.name())
.region("europe-west1")
.build())
.build())
.labels(Map.of("foo", "bar"))
.build());
var foo = new Topic("foo");
}
}

Import

Trigger can be imported using any of these accepted formats

$ pulumi import gcp:eventarc/trigger:Trigger default projects/{{project}}/locations/{{location}}/triggers/{{name}}
$ pulumi import gcp:eventarc/trigger:Trigger default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:eventarc/trigger:Trigger default {{location}}/{{name}}

Properties

Link copied to clipboard
val channel: Output<String>?

Optional. The name of the channel associated with the trigger in projects/{project}/locations/{location}/channels/{channel} format. You must provide a channel to receive events from Eventarc SaaS partners.

Link copied to clipboard
val conditions: Output<Map<String, String>>

Output only. The reason(s) why a trigger is in FAILED state.

Link copied to clipboard
val createTime: Output<String>

Output only. The creation time.

Link copied to clipboard

Required. Destination specifies where the events should be sent to.

Link copied to clipboard
val etag: Output<String>

Output only. This checksum is computed by the server based on the value of other fields, and may be sent only on create requests to ensure the client has an up-to-date value before proceeding.

Link copied to clipboard

Optional. EventDataContentType specifies the type of payload in MIME format that is expected from the CloudEvent data field. This is set to application/json if the value is not defined.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val labels: Output<Map<String, String>>?

Optional. User labels attached to the triggers that can be used to group resources.

Link copied to clipboard
val location: Output<String>

The location for the resource

Link copied to clipboard

Required. null The list of filters that applies to event attributes. Only events that match all the provided filters will be sent to the destination.

Link copied to clipboard
val name: Output<String>

Required. The resource name of the trigger. Must be unique within the location on the project.

Link copied to clipboard
val project: Output<String>

The project for the resource

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val serviceAccount: Output<String>?

Optional. The IAM service account email associated with the trigger. The service account represents the identity of the trigger. The principal who calls this API must have iam.serviceAccounts.actAs permission in the service account. See https://cloud.google.com/iam/docs/understanding-service-accounts#sa_common for more information. For Cloud Run destinations, this service account is used to generate identity tokens when invoking the service. See https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account for information on how to invoke authenticated Cloud Run services. In order to create Audit Log triggers, the service account should also have roles/eventarc.eventReceiver IAM role.

Link copied to clipboard

Optional. In order to deliver messages, Eventarc may use other GCP products as transport intermediary. This field contains a reference to that transport intermediary. This information can be used for debugging purposes.

Link copied to clipboard
val uid: Output<String>

Output only. Server assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

Link copied to clipboard
val updateTime: Output<String>

Output only. The last-modified time.

Link copied to clipboard
val urn: Output<String>