Event Targets

An EventTarget is a delivery destination for EventRecords.

Resource Schema

Required

PropertyDescription
name
String
Event Target name.
target_type
String
Event Target type.
Possible values: email, webhook, slack_webhook, teams_webhook, amazon_sns, google_pubsub, folder
config
Dynamic
Event Target configuration. Fields depend on target_type.

Optional

PropertyDescription
workspace_id
Int64
Workspace ID. 0 means the default workspace or site-wide.
apply_to_all_workspaces
Bool
If true, this default-workspace target can receive events from all workspaces.
enabled
Bool
Whether this Event Target can receive events.
delivery_policy
Dynamic
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400. Slack and Teams support delivery_mode (immediate or subfolder_summary), summary_path (empty string means root), and summary_delay (15–300 seconds, default 60). The summary applies to matching file activity under summary_path; other matching events retain immediate delivery.

Read Only

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

Example Resource

resource "files_event_target" "example_event_target" {
  name                    = "example"
  workspace_id            = 1
  apply_to_all_workspaces = true
  enabled                 = true
  config                  = {
    url               = "https://example.com/files-events"
    headers           = {
      X-Example = "value"
    }
    use_dedicated_ips = false
  }
  delivery_policy         = {
    max_attempts        = 3
    retry_delay_minutes = [1, 10]
  }
  target_type             = "webhook"
}

Resource Import

This Resource supports importing using the following syntax:

Example Import Command

# Event Targets can be imported by specifying the id.
terraform import files_event_target.example_event_target 1

Data Source Schema

Required

PropertyDescription
id
Int64
Event Target ID

Read Only

PropertyDescription
name
String
Event Target name.
target_type
String
Event Target type.
Possible values: email, webhook, slack_webhook, teams_webhook, amazon_sns, google_pubsub, folder
workspace_id
Int64
Workspace ID. 0 means the default workspace or site-wide.
apply_to_all_workspaces
Bool
If true, this default-workspace target can receive events from all workspaces.
enabled
Bool
Whether this Event Target can receive events.
config
Dynamic
Event Target configuration. Fields depend on target_type.
delivery_policy
Dynamic
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400. Slack and Teams support delivery_mode (immediate or subfolder_summary), summary_path (empty string means root), and summary_delay (15–300 seconds, default 60). The summary applies to matching file activity under summary_path; other matching events retain immediate delivery.
created_at
String
Event Target create date/time.
updated_at
String
Event Target update date/time.

Example Data Source

data "files_event_target" "example_event_target" {
  id = 1
}