Skip to main content
Manages a Kosli action. Actions send notifications to webhooks, Slack and email when artifact or environment events occur in the monitored environments. At least one of webhook_url, webhooks, slack_webhooks or emails is required.
Actions are identified internally by a server-assigned number. The name is used during import to look up the number.
Use this resource to configure automated notifications when environments change compliance state. An action can notify generic webhooks, Slack incoming webhooks and email addresses. See Targets.

Example usage

Triggers

The triggers attribute must contain one or more of the following event types:
ON_SCALED_ARTIFACT keeps its historical name for backwards compatibility. Kosli no longer records scaling events, so this trigger fires on artifact changes.

Targets

An action notifies one or more targets. Set at least one of the target attributes. One action can combine all of them. You can’t set webhook_url and webhooks together. To add a second webhook to an action that uses webhook_url, move the URL into webhooks. Terraform updates the action in place. Webhook URLs must use HTTPS and resolve to a public address. Kosli rejects a URL that points at an internal address.
Importing an action that has exactly one generic webhook stores the URL in webhook_url. A configuration that declares the same URL in webhooks shows a one-time in-place update on the next plan.

Import

You can’t import an action created from the Kosli Slack app. It’s tied to a Slack channel subscription that the resource doesn’t model. Manage it from Slack, or create a separate action with slack_webhooks.
Actions can be imported using their name:

Schema

Required

  • environments (List of String) List of environment names this action monitors.
  • name (String) Name of the action. Must be unique within the organization. Changing this will force recreation of the resource.
  • triggers (List of String) List of trigger event types that activate this action. One or more of ON_STARTED_ARTIFACT, ON_EXITED_ARTIFACT, ON_SCALED_ARTIFACT, ON_ALLOWED_ARTIFACT, ON_COMPLIANT_ENV, ON_NON_COMPLIANT_ENV. See Triggers for what each one fires on.

Optional

  • emails (Set of String) Email addresses the notifications are sent to.
  • slack_webhooks (Set of String, Sensitive) Slack incoming webhook URLs the notifications are posted to. Must use HTTPS.
  • webhook_url (String, Sensitive) A single generic webhook URL to send notifications to. Use webhooks for more than one. The two can’t be set together.
  • webhooks (Set of String, Sensitive) Generic webhook URLs the notifications are POSTed to as JSON (payload version 1.0). Must use HTTPS.

Read-only

  • created_by (String) User who created the action.
  • last_modified_at (Number) Unix timestamp of when the action was last modified.
  • number (Number) Server-assigned numeric identifier for the action.
Last modified on November 11, 2026