Skip to content

Commit

Permalink
Multiple updates, fixes (#1)
Browse files Browse the repository at this point in the history
Co-authored-by: Max Williams <[email protected]>
  • Loading branch information
max-rocket-internet and max-rocket-internet authored Aug 29, 2023
1 parent db794cc commit 262bde1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ See [example](example) for a full example implimentation of both modules, multip

```hcl
module "dashboard" {
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/dashboard?ref=1.4"
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/dashboard?ref=1.5"
regions = ["us-east-1"]
}
module "trusted_advisor_alarms" {
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/trusted_advisor_alarms?ref=1.4"
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/trusted_advisor_alarms?ref=1.5"
regions = ["us-east-1"]
}
module "usage_alarms" {
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/usage_alarms?ref=1.4"
source = "git::https://github.com/deliveryhero/terraform-aws-service-quota-alarms.git//modules/usage_alarms?ref=1.5"
}
```

Expand Down
4 changes: 2 additions & 2 deletions modules/dashboard/usage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ locals {
{
type = "metric"
properties = {
stat = "Sum"
stat = "Maximum"
region = region
period = 300
view = "timeSeries"
Expand All @@ -91,7 +91,7 @@ locals {
for metric in metrics : flatten([
[
"AWS/Usage", "ResourceCount", "Class", metric["class"], "Resource", metric["resource"], "Service", metric["service_name"], "Type", "Resource",
{ id = metric["id"], region = metric["region"], visible = false }
{ id = metric["id"], region = metric["region"], visible = false, "stat" = metric["resource"] == "NumberOfMessagesPublishedPerAccount" ? "Sum" : "Maximum" }
]
])
],
Expand Down
4 changes: 2 additions & 2 deletions modules/trusted_advisor_alarms/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ resource "aws_cloudwatch_metric_alarm" "main" {
metric_name = "ServiceLimitUsage"
namespace = "AWS/TrustedAdvisor"
ok_actions = var.cloudwatch_alarm_actions
period = 3600
statistic = "Average"
period = 300
statistic = "Maximum"
tags = var.tags
threshold = var.cloudwatch_alarm_threshold / 100
treat_missing_data = "ignore"
Expand Down
4 changes: 2 additions & 2 deletions modules/usage_alarms/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ resource "aws_cloudwatch_metric_alarm" "main" {
}
metric_name = "ResourceCount"
namespace = "AWS/Usage"
period = 3600
stat = "Average"
period = 300
stat = each.value["resource"] == "NumberOfMessagesPublishedPerAccount" ? "Sum" : "Maximum"
}
}
}

0 comments on commit 262bde1

Please sign in to comment.