diff --git a/docs/data-sources/alert.md b/docs/data-sources/alert.md index 3a3b05a5..974dfc42 100644 --- a/docs/data-sources/alert.md +++ b/docs/data-sources/alert.md @@ -8,19 +8,28 @@ page_title: "Coralogix: coralogix_alert" Use this data source to retrieve information about a Coralogix Alert. ## Example Usage - +Once an alert is created with TF you may wish to refer to it. +while the alert will have a UUID it's attributes may be called upon by name. ```hcl -data "coralogix_alert" "alert" { +data "coralogix_alert" "my_alert" { alert_id = "3dd35de0-0e10-11eb-9d0f-a1073519a608" } ``` +Using a code example like this will output the id of suce an alert: +```hcl +output "name" { + value = coralogix_alert.my_alert.alert_id + description = "Alert name." +} +``` + ## Argument Reference * `alert_id` - (Required) Alert ID. ## Attribute Reference - +The result is an object containing the following attributes. * `name` - Alert name. * `description` - Alert description. * `severity` - Alert severity. diff --git a/docs/data-sources/rule.md b/docs/data-sources/rule.md index 507317f2..b7d1e9a6 100644 --- a/docs/data-sources/rule.md +++ b/docs/data-sources/rule.md @@ -8,14 +8,23 @@ page_title: "Coralogix: coralogix_rule" Use this data source to retrieve information about a Coralogix Rule. ## Example Usage - +Once a rule group is created it can be refered to in your config. +This example describes the data structurre of the rule ```hcl -data "coralogix_rule" "rule" { +data "coralogix_rule" "my_rule" { rule_id = "e1a31d75-36ab-11e8-af8f-02420a00070c" rules_group_id = "e10ef9d1-36ab-11e8-af8f-02420a00070c" } ``` +Using a code example like this will output the id of suce a rule: +```hcl +output "name" { + value = coralogix_rule.my_rule.rule_id + description = "Rule name." +} +``` + ## Argument Reference * `rule_id` - (Required) Rule ID. diff --git a/docs/guides/authorization.md b/docs/guides/authorization.md index 144a8264..04cdf3a2 100644 --- a/docs/guides/authorization.md +++ b/docs/guides/authorization.md @@ -5,7 +5,41 @@ page_title: "Coralogix API Authorization" # Authorization -To allow interaction with Coralogix API you need to configure provider with API key. +To allow interaction with Coralogix API you need to configure provider with API key and the relevant api URL. -To get your API key you need [login](https://dashboard.coralogix.com/#/login) to your Coralogix account, go to ``Settings`` -> ``Account`` -> ``API Access`` -> ``Alerts & Rules API Key``. -API key should looks like valid UUID string. \ No newline at end of file +## To get your API key: +1. [Login to your Coralogix account](https://dashboard.coralogix.com/#/login) +2. On the upper options bar navigate the following: + ``Data Flow`` -> ``API Keys`` -> ``Alerts, Rules and Tags API Key`` +3. If the box containing the masked key is empty, click ``Generate new API key`` + +## To Get your URL string (Coralogix Endpoints): + +| Region | Logs Endpoint +|---------|------------------------------------------| +| EU | `https://api.coralogix.com/api/v1` | +| EU2 | `https://api.eu2.coralogix.com/api/v1` | +| US | `https://api.coralogix.us/api/v1` | +| SG | `https://api.coralogixsg.com/api/v1` | +| IN | `https://api.app.coralogix.in/api/v1` | + +## Example for application: +```hcl +# Set provider and it's source +terraform { + required_providers { + coralogix = { + source = "coralogix/coralogix" + version = "~> 1.0" + } + } +} + +# Configure the Coralogix Provider +provider "coralogix" { + api_key = "" + url = "https://api.eu2.coralogix.com/api/v1" + timeout = 30 +} + +``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 2c6755ab..c6b13f6b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,6 +16,7 @@ Use the navigation to the left to read about the available resources. Terraform 0.13 and later: ```hcl +# Set provider and it's source terraform { required_providers { coralogix = { @@ -28,7 +29,10 @@ terraform { # Configure the Coralogix Provider provider "coralogix" { api_key = "" + url = "" + timeout = 30 } + ``` Terraform 0.12 and earlier: