Skip to content

googleEventarcChannel

The Eventarc Channel resource

Example Usage - basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const dataGoogleKmsKeyRingTestKeyRing =
  new google.dataGoogleKmsKeyRing.DataGoogleKmsKeyRing(this, "test_key_ring", {
    location: "us-west1",
    name: "keyring",
  });
const dataGoogleProjectTestProject =
  new google.dataGoogleProject.DataGoogleProject(this, "test_project", {
    project_id: "my-project-name",
  });
const googleKmsCryptoKeyIamMemberKey1Member =
  new google.kmsCryptoKeyIamMember.KmsCryptoKeyIamMember(this, "key1_member", {
    crypto_key_id: "${data.google_kms_crypto_key.key1.id}",
    member: `serviceAccount:service-\${${dataGoogleProjectTestProject.number}}@gcp-sa-eventarc.iam.gserviceaccount.com`,
    role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
  });
new google.dataGoogleKmsCryptoKey.DataGoogleKmsCryptoKey(this, "key", {
  key_ring: dataGoogleKmsKeyRingTestKeyRing.id,
  name: "key",
});
new google.eventarcChannel.EventarcChannel(this, "primary", {
  crypto_key_name: "${data.google_kms_crypto_key.key1.id}",
  depends_on: [`\${${googleKmsCryptoKeyIamMemberKey1Member.fqn}}`],
  location: "us-west1",
  name: "channel",
  project: dataGoogleProjectTestProject.projectId,
  third_party_provider: `projects/\${${dataGoogleProjectTestProject.projectId}}/locations/us-west1/providers/datadog`,
});

Argument Reference

The following arguments are supported:

  • location - (Required) The location for the resource

  • name - (Required) Required. The resource name of the channel. Must be unique within the location on the project.


  • cryptoKeyName - (Optional) Optional. Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt their event data. It must match the pattern projects/*/locations/*/keyRings/*/cryptoKeys/*.

  • project - (Optional) The project for the resource

  • thirdPartyProvider - (Optional) The name of the event provider (e.g. Eventarc SaaS partner) associated with the channel. This provider will be granted permissions to publish events to the channel. Format: projects/{project}/locations/{location}/providers/{providerId}.

Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/channels/{{name}}

  • activationToken - Output only. The activation token for the channel. The token must be used by the provider to register the channel for publishing.

  • createTime - Output only. The creation time.

  • pubsubTopic - Output only. The name of the Pub/Sub topic created and managed by Eventarc system as a transport for the event delivery. Format: projects/{project}/topics/{topicId}.

  • state - Output only. The state of a Channel. Possible values: STATE_UNSPECIFIED, PENDING, ACTIVE, INACTIVE

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

  • updateTime - Output only. The last-modified time.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

Channel can be imported using any of these accepted formats:

$ terraform import google_eventarc_channel.default projects/{{project}}/locations/{{location}}/channels/{{name}}
$ terraform import google_eventarc_channel.default {{project}}/{{location}}/{{name}}
$ terraform import google_eventarc_channel.default {{location}}/{{name}}