The Coralogix Terraform provider lets you manage Coralogix resources—alerts, dashboards, TCO policies, recording rules, SLOs, webhooks, enrichment, and more—as infrastructure code. It requires **Terraform v1.3.0 or later**.

For the full resource and data source reference, see the [Terraform Registry](https://registry.terraform.io/providers/coralogix/coralogix/latest/docs). Source code and examples are on [GitHub](https://github.com/coralogix/terraform-provider-coralogix/tree/master/examples).

## Prerequisites

- A Coralogix account on the [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain/index.md) matching your data residency region.
- A [personal or team API key](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys/#overview) with permissions for the resources you intend to manage. Permission presets are recommended — they stay up to date automatically.
- [Terraform installed](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli).

## Configuration

### Provider block

```hcl
terraform {
  required_providers {
    coralogix = {
      source  = "coralogix/coralogix"
      version = "~> 3.0"
    }
  }
}

provider "coralogix" {
  api_key = "<your API key>"
  env     = "<your region>"  # EU1, EU2, US1, US2, AP1, AP2, AP3
}
```

### Authentication

Set credentials explicitly in the provider block (shown above), or via environment variables:

```bash
export CORALOGIX_API_KEY="<your API key>"
export CORALOGIX_ENV="<your region>"
```

### Provider arguments

| Argument  | Type               | Description                                                                                                                                                                       |
| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `api_key` | string (sensitive) | API key with permissions for the resources you are managing                                                                                                                       |
| `env`     | string             | Region matching your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain/index.md) (EU1, EU2, US1, US2, AP1, AP2, AP3) |

## Resources and data sources

The provider covers alerts, dashboards, TCO policies, recording rules, SLOs, webhooks, enrichment, and more. For the full list with usage examples, see the [Terraform Registry documentation](https://registry.terraform.io/providers/coralogix/coralogix/latest/docs).

## Report issues

Found a bug or want to contribute? Open an issue on [GitHub](https://github.com/coralogix/terraform-provider-coralogix/issues).
