Skip to content

Commit

Permalink
Coralogix webhook docs update (#282)
Browse files Browse the repository at this point in the history
* update coralogix_webhook docs

* add datasource example

* fixing examples
  • Loading branch information
OrNovo authored Oct 20, 2024
1 parent 4ceb865 commit a8ec19c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
34 changes: 32 additions & 2 deletions docs/data-sources/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,43 @@ Coralogix webhook. For more info please review - https://coralogix.com/docs/cora

```hcl
data "coralogix_webhook" "imported_webhook_by_id" {
id = coralogix_webhook.slack_webhook.id
id = "60f3b3b3d7b3b00001b3b3b3"
}
data "coralogix_webhook" "imported_webhook_by_name" {
id = coralogix_webhook.slack_webhook.name
name = "slack-webhook"
}
```

## Example Usage of link webhook to alert.
### **please note that the linkage is done by the external_id (and not by the id)**
```hcl
data "coralogix_webhook" "imported_webhook_by_id" {
name = "slack-webhook"
}
resource "coralogix_alert" "standard_alert" {
name = "Standard alert example"
description = "Example of standard alert from terraform"
severity = "Critical"
notifications_group {
notification {
integration_id = data.coralogix_webhook.imported_webhook_by_id.external_id
retriggering_period_minutes = 60
notify_on = "Triggered_only"
}
}
standard {
search_query = "remote_addr_enriched:/.*/"
condition {
immediately = true
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down
32 changes: 32 additions & 0 deletions docs/resources/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,38 @@ resource "coralogix_webhook" "slack_webhook" {
}
```

## Example Usage of link webhook to alert.
### **please note that the linkage is done by the external_id (and not by the id)**
```hcl
resource "coralogix_webhook" "slack_webhook" {
name = "slack-webhook"
slack = {
notify_on = ["flow_anomalies"]
url = "https://join.slack.com/example"
}
}
resource "coralogix_alert" "standard_alert" {
name = "Standard alert example"
description = "Example of standard alert from terraform"
severity = "Critical"
notifications_group {
notification {
integration_id = coralogix_webhook.slack_webhook.external_id
retriggering_period_minutes = 60
notify_on = "Triggered_only"
}
}
standard {
search_query = "remote_addr_enriched:/.*/"
condition {
immediately = true
}
}
}
```


<!-- schema generated by tfplugindocs -->
Expand Down

0 comments on commit a8ec19c

Please sign in to comment.