Created
June 3, 2025 16:29
-
-
Save lioneltchami/8e5d1eb82050c2591bdc1929319e7aec to your computer and use it in GitHub Desktop.
π§ Metric #3: ECS Task CPU Utilization. Keep task CPU usage under 80% for healthy performance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "awscc_applicationsignals_service_level_objective" "cpu_utilization_slo" { | |
name = "ecs-cpu-slo" | |
description = "Keep ECS CPU Utilization below 80%" | |
sli = { | |
comparison_operator = "LessThan" | |
metric_threshold = 80.0 | |
sli_metric = { | |
metric_data_queries = [{ | |
id = "cpu" | |
metric_stat = { | |
metric = { | |
namespace = "AWS/ECS" | |
metric_name = "CPUUtilization" | |
dimensions = [ | |
{ | |
name = "ClusterName" | |
value = "my-cluster-name" | |
}, | |
{ | |
name = "ServiceName" | |
value = "my-service-name" | |
} | |
] | |
} | |
period = 300 | |
stat = "Average" | |
} | |
}] | |
} | |
} | |
goal = { | |
attainment_goal = 99.5 | |
interval = { | |
rolling_interval = { | |
duration = 7 | |
duration_unit = "DAY" | |
} | |
} | |
} | |
burn_rate_configurations = [ | |
{ look_back_window_minutes = 60 }, | |
{ look_back_window_minutes = 1440 } | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment