aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/digitalocean/server/alerts.tf
blob: e8a2c19a6516e38eb3cc198868a8ee2554babd3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
data "digitalocean_account" "this" {
}

resource "digitalocean_monitor_alert" "cpu" {
  alerts {
    email = [data.digitalocean_account.this.email]
  }
  description = "CPU utilization on ${digitalocean_droplet.this.name}"
  window      = "5m"
  type        = "v1/insights/droplet/cpu"
  compare     = "GreaterThan"
  value       = 70
  enabled     = true
  entities    = [digitalocean_droplet.this.id]
}

resource "digitalocean_monitor_alert" "load1" {
  alerts {
    email = [data.digitalocean_account.this.email]
  }
  description = "1-min load avg on ${digitalocean_droplet.this.name}"
  window      = "5m"
  type        = "v1/insights/droplet/load_1"
  compare     = "GreaterThan"
  value       = 5
  enabled     = true
  entities    = [digitalocean_droplet.this.id]
}