diff options
Diffstat (limited to 'digitalocean/server/alerts.tf')
-rw-r--r-- | digitalocean/server/alerts.tf | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/digitalocean/server/alerts.tf b/digitalocean/server/alerts.tf new file mode 100644 index 0000000..e8a2c19 --- /dev/null +++ b/digitalocean/server/alerts.tf @@ -0,0 +1,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] +} |