Skip to content

Commit

Permalink
Add webhook alert from Checkly -> Instatus (#2840)
Browse files Browse the repository at this point in the history
* Add webhook alert from Checkly -> Instatus

* `terraform fmt`

* Send api healthcheck failures to TF

---------

Co-authored-by: Cenk Kücük <[email protected]>
  • Loading branch information
ukutaht and cnkk committed Jul 12, 2023
1 parent 6fa558b commit c550a87
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/e2e/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ variable "checkly_alert_channel_pagerduty_service_key" {
sensitive = true
}

variable "checkly_alert_channel_instatus_webhook_url" {
sensitive = true
}

provider "checkly" {
api_key = var.checkly_api_key
account_id = var.checkly_account_id
Expand All @@ -40,6 +44,11 @@ resource "checkly_check" "plausible-io-api-health" {

group_id = checkly_check_group.reachability.id

alert_channel_subscription {
channel_id = checkly_alert_channel.instatus.id
activated = true
}

request {
url = "https://plausible.io/api/health"
follow_redirects = false
Expand Down Expand Up @@ -230,3 +239,14 @@ resource "checkly_alert_channel" "pagerduty" {
service_name = "Plausible application"
}
}

resource "checkly_alert_channel" "instatus" {
webhook {
name = "Instatus integration"
method = "POST"
template = <<EOT
{"alert": "{{ALERT_TYPE}}"}
EOT
url = var.checkly_alert_channel_instatus_webhook_url
}
}

0 comments on commit c550a87

Please sign in to comment.