digitalocean_monitor_alert

Provides a DigitalOcean Monitoring resource. Monitor alerts can be configured to alert about, e.g., disk or memory usage exceeding a certain threshold or traffic at a certain limit. Notifications can be sent to either an email address or a Slack channel.

Basic Example

# Create a new Web Droplet in the nyc2 region
resource "digitalocean_droplet" "web" {
  image  = "ubuntu-20-04-x64"
  name   = "web-1"
  region = "nyc2"
  size   = "s-1vcpu-1gb"
}

resource "digitalocean_monitor_alert" "cpu_alert" {
  alerts {
    email = ["sammy@digitalocean.com"]
    slack {
      channel = "Production Alerts"
      url     = "https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ"
    }
  }
  window      = "5m"
  type        = "v1/insights/droplet/cpu"
  compare     = "GreaterThan"
  value       = 95
  enabled     = true
  entities    = [digitalocean_droplet.web.id]
  description = "Alert about CPU usage"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported.

Import

Monitor alerts can be imported using the monitor alert uuid, e.g.

terraform import digitalocean_monitor_alert.cpu_alert b8ecd2ab-2267-4a5e-8692-cbf1d32583e3