Event Subscriptions

An EventSubscription selects EventRecords for an EventChannel and sends them to one or more EventTargets.

Resource Schema

Required

PropertyDescription
name
String
Event Subscription name.

Optional

PropertyDescription
event_channel_id
Int64
Event Channel ID
workspace_id
Int64
Workspace ID. 0 means the default workspace or site-wide.
apply_to_all_workspaces
Bool
If true, this default-workspace subscription applies to events from all workspaces.
subject
String
Custom subject line to use for notification emails.
message
String
Custom message to include in notification emails.
message_only
Bool
If true, notification email bodies contain only the custom message, omitting event details and the review button. Requires a custom message, defaults to false, and does not affect non-email targets.
enabled
Bool
Whether this Event Subscription can dispatch events.
event_types
List
Event type strings matched by this subscription. Blank means all event types.
filter
Dynamic
Structured event payload filter.
delivery_policy
Dynamic
Event Subscription delivery policy.
event_target_ids
List
Event Target IDs this subscription sends to.

Read Only

PropertyDescription
id
Int64
Event Subscription ID
created_at
String
Event Subscription create date/time.
updated_at
String
Event Subscription update date/time.

Example Resource

resource "files_event_subscription" "example_event_subscription" {
  event_channel_id        = 1
  workspace_id            = 1
  apply_to_all_workspaces = true
  name                    = "example"
  subject                 = "example"
  message                 = "example"
  message_only            = true
  enabled                 = true
  event_types             = ["example"]
  delivery_policy         = "example"
  event_target_ids        = [1]
}

Resource Import

This Resource supports importing using the following syntax:

Example Import Command

# Event Subscriptions can be imported by specifying the id.
terraform import files_event_subscription.example_event_subscription 1

Data Source Schema

Required

PropertyDescription
id
Int64
Event Subscription ID

Read Only

PropertyDescription
event_channel_id
Int64
Event Channel ID
workspace_id
Int64
Workspace ID. 0 means the default workspace or site-wide.
apply_to_all_workspaces
Bool
If true, this default-workspace subscription applies to events from all workspaces.
name
String
Event Subscription name.
subject
String
Custom subject line to use for notification emails.
message
String
Custom message to include in notification emails.
message_only
Bool
If true, notification email bodies contain only the custom message, omitting event details and the review button. Requires a custom message, defaults to false, and does not affect non-email targets.
enabled
Bool
Whether this Event Subscription can dispatch events.
event_types
List
Event type strings matched by this subscription. Blank means all event types.
filter
Dynamic
Structured event payload filter.
delivery_policy
Dynamic
Event Subscription delivery policy.
event_target_ids
List
Event Target IDs this subscription sends to.
created_at
String
Event Subscription create date/time.
updated_at
String
Event Subscription update date/time.

Example Data Source

data "files_event_subscription" "example_event_subscription" {
  id = 1
}