Skip to content

Commit

Permalink
added better documentation for alerts, rules and general auth actions (
Browse files Browse the repository at this point in the history
…#13)

* added better documentation for alerts, rules and general auth actions
* fixed PR rejects
  • Loading branch information
talknopf authored May 8, 2022
1 parent 983306d commit 918a4ad
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 8 deletions.
15 changes: 12 additions & 3 deletions docs/data-sources/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 11 additions & 2 deletions docs/data-sources/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
40 changes: 37 additions & 3 deletions docs/guides/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
## 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 = "<my secret Alerts, Rules and Tags API Key>"
url = "https://api.eu2.coralogix.com/api/v1"
timeout = 30
}
```
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -28,7 +29,10 @@ terraform {
# Configure the Coralogix Provider
provider "coralogix" {
api_key = ""
url = ""
timeout = 30
}
```

Terraform 0.12 and earlier:
Expand Down

0 comments on commit 918a4ad

Please sign in to comment.