digitalocean_uptime_alert

Provides a DigitalOcean Uptime Alerts resource. Uptime Alerts provide the ability to add alerts to your DigitalOcean Uptime Checks when your endpoints are slow, unavailable, or SSL certificates are expiring.

Basic Example

# Create a new check for the target endpoint in a specific region
resource "digitalocean_uptime_check" "foobar" {
  name    = "example-europe-check"
  target  = "https://www.example.com"
  regions = ["eu_west"]
}

# Create a latency alert for the uptime check
resource "digitalocean_uptime_alert" "alert-example" {
  name       = "latency-alert"
  check_id   = digitalocean_uptime_check.foobar.id
  type       = "latency"
  threshold  = 300
  comparison = "greater_than"
  period     = "2m"
  notifications {
    email = ["sammy@digitalocean.com"]
    slack {
      channel = "Production Alerts"
      url     = "https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ"
    }
  }
}

Argument Reference

The following arguments are supported:

notifications supports the following:

Attributes Reference

The following attributes are exported.

Import

Uptime alerts can be imported using both the ID of the alert's parent check and its own separated by a comma in the format: check_id,alert_id. For example:

terraform import digitalocean_uptime_alert.target 94a7d216-d821-11ee-a327-33d3239ffc4b,5a4981aa-9653-4bd1-bef5-d6bff52042e4