Coralogix Terraform Provider
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.
-
To use this API you need to create a personal or team API key. It’s recommended to use permission presets, as they are automatically updated with all relevant permissions. Alternatively, you can manually add individual permissions. Assign permissions to the API key based on the specific Terraform functionality you intend to use.
-
Install Terraform.
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 a CORALOGIX_API_KEY env variable>"
env = "<add the environment where you want to work or add a CORALOGIX_ENV env variable>"
}
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 = "<cx_api_key>"
env = "<add the environment where you want to work>"
}
- implicitly:
Argument Reference
-
api_key
(string, sensitive). An API key appropriate for the defined environment and functionality. -
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_events2metric` (previously coralogix_logs2metric)
coralogix_recording_rules_group
Data Sources
Set up alerts in your account as follows:
coralogix_events2metric (previously coralogix_logs2metric)
coralogix_recording_rules_group
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].