Review ECS Container Insights settings

Collect the operational information you need through ECS Container Insights.

Description

ECS Container Insights provides detailed CloudWatch information about cluster and service CPU, memory and other operational metrics. Missing information can delay diagnosis of failures or performance problems.

An omitted cluster setting can inherit the account setting, so verify the effective state. Disabling Container Insights does not stop collection of every basic ECS metric.

Potential impact

  • Resource shortages or performance problems can be noticed late.
  • Service diagnosis and recovery can take longer.

Remediation

Specify name = "containerInsights" and value = "enabled" in a setting block. Consider enhanced where your provider supports it and additional detail is needed. Review costs and collection permissions, then verify CloudWatch metrics, dashboards and alarms.

Examples

Before

hcl
resource "aws_ecs_cluster" "example" {
  name = "white-hart"
}

There is no cluster-specific setting. Check the account default and the effective state.

After

hcl
resource "aws_ecs_cluster" "example" {
  name = "white-hart"

  setting {
    name  = "containerInsights"
    value = "enabled"
  }
}

This explicitly enables Container Insights on the same cluster. Configure the alarms and operational response procedures you need as well.

References