11resource "aws_cloudwatch_metric_alarm" "high_memory" {
22 count = length (var. alarm_sns_topics ) > 0 ? 1 : 0
33
4- alarm_name = " ${ data . aws_iam_account_alias . current . account_alias } -ecs-${ var . name } -high-memory"
5- comparison_operator = " GreaterThanOrEqualToThreshold"
6- evaluation_periods = " 3"
7- metric_name = " MemoryUtilization"
8- namespace = " AWS/ECS"
9- period = " 300"
10- statistic = " Maximum"
11- threshold = " 80"
12- alarm_description = " Cluster node memory above threshold"
13- alarm_actions = var. alarm_sns_topics
14- ok_actions = var. alarm_sns_topics
4+ alarm_name = " ${ data . aws_iam_account_alias . current . account_alias } -ecs-${ var . name } -high-memory"
5+ comparison_operator = " GreaterThanOrEqualToThreshold"
6+ evaluation_periods = " 3"
7+ metric_name = " MemoryUtilization"
8+ namespace = " AWS/ECS"
9+ period = " 300"
10+ statistic = " Maximum"
11+ threshold = " 80"
12+ alarm_description = " Cluster node memory above threshold"
13+ alarm_actions = var. alarm_sns_topics
14+ ok_actions = var. alarm_sns_topics
1515
1616 dimensions = {
1717 ClusterName = aws_ecs_cluster.ecs.name
@@ -21,17 +21,17 @@ resource "aws_cloudwatch_metric_alarm" "high_memory" {
2121resource "aws_cloudwatch_metric_alarm" "high_cpu" {
2222 count = length (var. alarm_sns_topics ) > 0 ? 1 : 0
2323
24- alarm_name = " ${ data . aws_iam_account_alias . current . account_alias } -ecs-${ var . name } -high-cpu"
25- comparison_operator = " GreaterThanOrEqualToThreshold"
26- evaluation_periods = " 3"
27- metric_name = " CPUUtilization"
28- namespace = " AWS/ECS"
29- period = " 300"
30- statistic = " Maximum"
31- threshold = " 80"
32- alarm_description = " Cluster node CPU above threshold"
33- alarm_actions = var. alarm_sns_topics
34- ok_actions = var. alarm_sns_topics
24+ alarm_name = " ${ data . aws_iam_account_alias . current . account_alias } -ecs-${ var . name } -high-cpu"
25+ comparison_operator = " GreaterThanOrEqualToThreshold"
26+ evaluation_periods = " 3"
27+ metric_name = " CPUUtilization"
28+ namespace = " AWS/ECS"
29+ period = " 300"
30+ statistic = " Maximum"
31+ threshold = " 80"
32+ alarm_description = " Cluster node CPU above threshold"
33+ alarm_actions = var. alarm_sns_topics
34+ ok_actions = var. alarm_sns_topics
3535
3636 dimensions = {
3737 ClusterName = aws_ecs_cluster.ecs.name
0 commit comments