Skip to content

Commit

Permalink
fix: PAI-2050: add kms usage alarms (#5)
Browse files Browse the repository at this point in the history
* add new usage metrices

* update var definition

* add kms usage metrics to be used publicly

* fix metric name

* fix metric name

---------

Co-authored-by: Max Williams <[email protected]>
  • Loading branch information
mkamel93 and max-rocket-internet authored Aug 7, 2024
1 parent 274dae4 commit a3aa1c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/usage_alarms/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ resource "aws_cloudwatch_metric_alarm" "main" {
"Class" = each.value["class"]
"Resource" = each.value["resource"]
"Service" = each.value["service_name"]
"Type" = "Resource"
"Type" = startswith(each.value["resource"], "CryptographicOperations") ? "API" : "Resource"
}
metric_name = "ResourceCount"
metric_name = startswith(each.value["resource"], "CryptographicOperations") ? "CallCount" : "ResourceCount"
namespace = "AWS/Usage"
period = 300
stat = each.value["resource"] == "NumberOfMessagesPublishedPerAccount" ? "Sum" : "Maximum"
Expand Down

0 comments on commit a3aa1c1

Please sign in to comment.