marusich pushed a commit to branch master
in repository maintenance.

commit 0796267b6b47a027df54c2445303d5738816ebfa
Author: Chris Marusich <[email protected]>
Date:   Sat Dec 29 12:57:36 2018 -0800

    cdn: Alarm when we start paying money.
    
    * cdn/terraform/main.tf (alarm-free-tier-exceeded): New alarm.
---
 cdn/terraform/main.tf | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/cdn/terraform/main.tf b/cdn/terraform/main.tf
index 93b9936..8551918 100644
--- a/cdn/terraform/main.tf
+++ b/cdn/terraform/main.tf
@@ -422,3 +422,20 @@ resource "aws_cloudwatch_metric_alarm" 
"alarm-estimated-charges-100-usd" {
     Currency = "USD"
   }
 }
+
+resource "aws_cloudwatch_metric_alarm" "alarm-free-tier-exceeded" {
+  alarm_name = "alarm-free-tier-exceeded"
+  alarm_description = "Free tier exceeded - further usage will cost money"
+  namespace = "AWS/Billing"
+  metric_name = "EstimatedCharges"
+  statistic = "Maximum"
+  period = "21600" # 6 hours
+  evaluation_periods = "1"
+  comparison_operator = "GreaterThanThreshold"
+  threshold = "0"
+  actions_enabled = true
+  alarm_actions = ["${aws_sns_topic.guix-billing-alarms.arn}"]
+  dimensions {
+    Currency = "USD"
+  }
+}

Reply via email to