Skip to content

Instantly share code, notes, and snippets.

@lioneltchami
Created June 3, 2025 16:29
Show Gist options
  • Save lioneltchami/8e5d1eb82050c2591bdc1929319e7aec to your computer and use it in GitHub Desktop.
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.
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