add a basic cw alarm master
authorJustin Wind <j.wind@partner.samsung.com>
Wed, 15 Nov 2017 19:22:49 +0000 (11:22 -0800)
committerJustin Wind <j.wind@partner.samsung.com>
Wed, 15 Nov 2017 19:22:49 +0000 (11:22 -0800)
infrastructure/modules/management-stack/alarms.tf
infrastructure/modules/management-stack/iam.tf

index c278d190cf6ebd7df8e8039c8bc2d441670885f8..3e244fb8fd8d0dbb1054708cebcfbf07b0622936 100644 (file)
@@ -29,3 +29,16 @@ resource "aws_cloudwatch_metric_alarm" "failures-present" {
        }
        alarm_actions = ["${aws_sns_topic.management-alerts.arn}"]
 }
+
+resource "aws_cloudwatch_metric_alarm" "unhealthy" {
+       alarm_name = "UnhealthyHostCount"
+       alarm_description = "Alert when any ELB has unhealthy hosts."
+       metric_name = "UnHealthyHostCount"
+       comparison_operator = "GreaterThanOrEqualToThreshold"
+       evaluation_periods = 15
+       period = 60
+       namespace = "AWS/ELB"
+       statistic = "Maximum"
+       threshold = 1
+       alarm_actions = ["${aws_sns_topic.management-alerts.arn}"]
+}
\ No newline at end of file
index 3f8513448eacfd1bd8e796f55d796b7023dfc803..78783a152464e82df065d7d4381e0daa8a4997ed 100644 (file)
@@ -23,10 +23,15 @@ data "aws_iam_policy_document" "management" {
                sid = "AWSControl"
                actions = [
                        "autoscaling:*",
+                       "cloudwatch:ListMetrics",
+                       "cloudwatch:GetMetricStatistics",
+                       "cloudwatch:Describe*",
                        "ec2:*",
                        "elasticloadbalancing:*",
                        "iam:PassRole",
-                       "iam:GetServerCertificate"
+                       "iam:GetServerCertificate",
+                       "logs:DescribeLogStreams",
+                       "logs:PutLogEvents",
                ]
                resources = [
                        "*"