Our next-gen architecture is built to help you make sense of your ever-growing data Watch a 4-min demo video!

Back to All Docs

Coralogix Terraform Provider Coralogix Terraform Provider

Last Updated: Nov. 28, 2022

The Coralogix terraform provider is used to interact with the resources supported by Coralogix. The provider needs to be configured with the proper credentials before it can be used. It requires terraform 0.12 or later.

View our comprehensive usage guide in the terraform registry to learn more and view examples of how to use the terraform provider to manage Coralogix rules and alerts. You can also view our open source code in its official Github repository.

Note! The Coralogix terraform registry has now been updated to v1.3.x. The new version contains many breaking changes and does not support webhooks. It should be configured by following the instructions below.

Prerequisites

  1. Sign up for a Coralogix account. Set up your account on the Coralogix domain corresponding to the region within which you would like your data stored.
  2. Access your Coralogix API key:
  • In your Coralogix account, open the Data Flow dropdown menu in the toolbar, and select API Keys.
  • On the API Keys page, copy the information in the Alerts, Rules and Tags API Key field.
  1. Install Terraform.

Configuration

Example Usage

provider "coralogix" {
  api_key = "<add your api key here or add env variable CORALOGIX_API_KEY>"
  env = "<add the environment where you want to work or add env variable CORALOGIX_ENV>"
}

resource "coralogix_rules_group" "my_first_rules_group" {
  name = "my first rules_group"
}

Authentication

The API key and desired environment for using the Coralogix provider can be set in two ways, either explicitly or implicitly through environment variables.

  • explicitly:
provider "coralogix" {
api_key = "<add your api key>"
env = "<add the environment where you want to work>"
}
  • implicitly:
$ export CORALOGIX_API_KEY="<add your api key>"
$ export CORALOGIX_ENV="<add the environment where you want to work>"

Argument Reference

  • api_key (string, sensitive). A key for alerts, rules, and logs2metric APIs (auto generated), appropriate for the defined environment.
  • env (string). The Coralogix API environment should be the region [“APAC1”, “APAC2”, “EUROPE1”, “EUROPE2”, or “USA1”] associated with your Coralogix domain.

Resources

Set up parsing rules and groups in your account as follows:

coralogix_alert

coralogix_logs2metric

coralogix_rules_group

Data Sources

Set up alerts in your account as follows:

coralogix_alert

coralogix_logs2metric

coralogix_rules_group

v1.2.x

If you do not wish to upgrade to v1.3.x, set the version field to "~> 1.2" in your terraform file:

terraform {  required_providers {    coralogix = {      version = "~> 1.2"      source  = "coralogix/coralogix"    }  }}

Report Issues

We welcome your contribution to our open source code! Share your ideas and report any bugs here.

On this page