Skip to content

Commit 262bde1

Browse files
Multiple updates, fixes (#1)
Co-authored-by: Max Williams <[email protected]>
1 parent db794cc commit 262bde1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ See [example](example) for a full example implimentation of both modules, multip
1212

1313
```hcl
1414
module "dashboard" {
15-
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/dashboard?ref=1.4"
15+
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/dashboard?ref=1.5"
1616
regions = ["us-east-1"]
1717
}
1818
1919
module "trusted_advisor_alarms" {
20-
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/trusted_advisor_alarms?ref=1.4"
20+
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/trusted_advisor_alarms?ref=1.5"
2121
regions = ["us-east-1"]
2222
}
2323
2424
module "usage_alarms" {
25-
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/usage_alarms?ref=1.4"
25+
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/usage_alarms?ref=1.5"
2626
}
2727
```
2828

modules/dashboard/usage.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ locals {
7474
{
7575
type = "metric"
7676
properties = {
77-
stat = "Sum"
77+
stat = "Maximum"
7878
region = region
7979
period = 300
8080
view = "timeSeries"
@@ -91,7 +91,7 @@ locals {
9191
for metric in metrics : flatten([
9292
[
9393
"AWS/Usage", "ResourceCount", "Class", metric["class"], "Resource", metric["resource"], "Service", metric["service_name"], "Type", "Resource",
94-
{ id = metric["id"], region = metric["region"], visible = false }
94+
{ id = metric["id"], region = metric["region"], visible = false, "stat" = metric["resource"] == "NumberOfMessagesPublishedPerAccount" ? "Sum" : "Maximum" }
9595
]
9696
])
9797
],

modules/trusted_advisor_alarms/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ resource "aws_cloudwatch_metric_alarm" "main" {
107107
metric_name = "ServiceLimitUsage"
108108
namespace = "AWS/TrustedAdvisor"
109109
ok_actions = var.cloudwatch_alarm_actions
110-
period = 3600
111-
statistic = "Average"
110+
period = 300
111+
statistic = "Maximum"
112112
tags = var.tags
113113
threshold = var.cloudwatch_alarm_threshold / 100
114114
treat_missing_data = "ignore"

modules/usage_alarms/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ resource "aws_cloudwatch_metric_alarm" "main" {
112112
}
113113
metric_name = "ResourceCount"
114114
namespace = "AWS/Usage"
115-
period = 3600
116-
stat = "Average"
115+
period = 300
116+
stat = each.value["resource"] == "NumberOfMessagesPublishedPerAccount" ? "Sum" : "Maximum"
117117
}
118118
}
119119
}

0 commit comments

Comments
 (0)