Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added better documentation for alerts, rules and general auth actions #13

Merged
merged 2 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 mau wish to refer to it.
talknopf marked this conversation as resolved.
Show resolved Hide resolved
while the alert will have a UUID it's attributes may be caleld upon by name.
talknopf marked this conversation as resolved.
Show resolved Hide resolved
```hcl
data "coralogix_alert" "alert" {
data "coralogix_alert" "my_alert" {
alert_id = "3dd35de0-0e10-11eb-9d0f-a1073519a608"
}
```

Using a code exmple like this will output the id of suce an alert:
talknopf marked this conversation as resolved.
Show resolved Hide resolved
```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.
talknopf marked this conversation as resolved.
Show resolved Hide resolved
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 exmple like this will output the id of suce a rule:
talknopf marked this conversation as resolved.
Show resolved Hide resolved
```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