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: Jan. 30, 2024

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 v1.3.0 or later.

View the latest version of our comprehensive usage guide in the terraform registry to learn more and view examples of how to use the terraform provider to manage Coralogix resources and APIs.

You can also view our open source code in its official GitHub repository.

Prerequisites

  • 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.
  • 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.

Configuration

Example Usage

terraform {
  required_providers {
    coralogix = {
      version = "<your desired version>"
      source  = "coralogix/coralogix"
    }
  }
}
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 events2metric 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_action

coralogix_alert

coralogix_dashboard

coralogix_data_set

coralogix_enrichment

coralogix_hosted_dashboard

coralogix_events2metric (previously coralogix_logs2metric)

coralogix_recording_rules_group

coralogix_rules_group

coralogix_slo

coralogix_tco_policy_logs

coralogix_tco_policy_override

coralogix_tco_policy_traces

coralogix_webhook

Data Sources

Set up alerts in your account as follows:

coralogix_action

coralogix_alert

coralogix_dashboard

coralogix_data_set

coralogix_enrichment

coralogix_hosted_dashboard

coralogix_events2metric (previously coralogix_logs2metric)

coralogix_recording_rules_group

coralogix_rules_group

coralogix_slo

coralogix_tco_policy_logs

coralogix_tco_policy_override

coralogix_tco_policy_traces

coralogix_webhook

Report Issues

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

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].

On this page