> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kosli.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.kosli.com/feedback

```json
{
  "path": "/terraform-reference/data-sources/action",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# kosli_action data source

> Fetches details of an existing Kosli action.

Fetches details of an existing Kosli action.

Use this data source to reference existing actions and access metadata such as the environments being monitored and the trigger types configured.

## Example usage

```terraform theme={"theme":"dracula","languages":{"custom":["/languages/rego.json"]}}
terraform {
  required_providers {
    kosli = {
      source = "kosli-dev/kosli"
    }
  }
}

# Query an existing action
data "kosli_action" "compliance_alerts" {
  name = "compliance-alerts"
}

output "action_number" {
  description = "Server-assigned number of the action"
  value       = data.kosli_action.compliance_alerts.number
}

output "action_environments" {
  description = "Environments monitored by this action"
  value       = data.kosli_action.compliance_alerts.environments
}
```

## Schema

### Required

* `name` (String) The name of the action to query.

### Read-only

* `created_by` (String) User who created the action.
* `environments` (List of String) List of environment names this action monitors.
* `last_modified_at` (Number) Unix timestamp (with fractional seconds) of when the action was last modified.
* `number` (Number) Server-assigned numeric identifier for the action.
* `triggers` (List of String) List of trigger event types that activate this action.
