-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
32 lines (26 loc) · 915 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
terraform {
required_version = ">= 1.0.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.0.0"
}
}
}
resource "aws_cloudwatch_metric_alarm" "this" {
alarm_name = "${var.aurora_db_cluster_identifier}-aurora-cpu-surplus-credits-charged"
alarm_description = "${var.aurora_db_cluster_identifier} has incurred charges for overspent CPU credits."
metric_name = "CPUCreditSurplusCreditsCharged"
namespace = "AWS/RDS"
dimensions = {
DBClusterIdentifier = var.aurora_db_cluster_identifier
}
statistic = "Sum"
comparison_operator = "GreaterThanOrEqualToThreshold"
threshold = var.amount_of_overspent_credits
period = var.period
evaluation_periods = var.times_failed
treat_missing_data = var.treat_missing_data
alarm_actions = var.alarm_sns_topic_arns
ok_actions = var.alarm_sns_topic_arns
}