Coralogix Terraform Provider
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. Source code and examples are on GitHub.
Prerequisites
- A Coralogix account on the domain matching your data residency region, or a tenant in the FedRAMP environment.
- A personal or team API key with permissions for the resources you intend to manage. Permission presets are recommended. They stay up to date automatically.
- Terraform installed.
Configuration
Provider block
terraform {
required_providers {
coralogix = {
source = "coralogix/coralogix"
version = "~> 3.0"
}
}
}
provider "coralogix" {
api_key = "<your API key>"
env = "<your region>" # EU1, EU2, US1, US2, US3, AP1, AP2, AP3
}
Authentication
Set credentials explicitly in the provider block (shown above), or via environment variables:
export CORALOGIX_API_KEY="<your API key>"
export CORALOGIX_ENV="<your region>"
Environments that env does not cover, including FedRAMP, use CORALOGIX_DOMAIN in place of CORALOGIX_ENV.
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. One of EU1, EU2, US1, US2, US3, AP1, AP2, AP3. Conflicts with domain |
domain | string | Coralogix hostname to target, for environments that env does not cover: the FedRAMP environment, or an AWS PrivateLink management host such as api.private.eu2.coralogix.com. Conflicts with env |
Set env or domain, never both. The provider rejects a configuration that sets both, and one of them is required.
FedRAMP and AWS GovCloud
The FedRAMP environment is not one of the values env accepts. env = "GOV1" fails validation. Use domain instead:
provider "coralogix" {
api_key = "<your API key>"
domain = "gov1.coralogixgov.us"
}
Or through the environment:
export CORALOGIX_API_KEY="<your API key>"
export CORALOGIX_DOMAIN="gov1.coralogixgov.us"
The provider derives its API targets from that hostname: ng-api-grpc.gov1.coralogixgov.us:443 for gRPC calls and https://api.gov1.coralogixgov.us for REST calls. Use an API key issued in your FedRAMP tenant. A key from a commercial Coralogix account does not authenticate against the FedRAMP environment.
If you connect over AWS PrivateLink from AWS GovCloud, set domain to the private management host instead. The provider recognizes an api.private. prefix and targets that host directly rather than prefixing it.
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.
Report issues
Found a bug or want to contribute? Open an issue on GitHub.