Does ECS with Fargate support Detailed Monitoring? If so, how do I enable it for a service in Terraform?

Viewed 13

I'd like to enable 1-minute resolution of the CloudWatch metrics ECSServiceAverageMemoryUtilization and ECSServiceAverageCPUUtilization. I understand that by default, they are only updated every 5 minutes unless you enabled Detailed Monitoring, but I'm unclear on how to enable this.

I googled around and had no luck, only finding descriptions of what Detailed Monitoring is, how much it costs, etc.

I looked through both these documents:

but see no mention of it.

Is this maybe an account setting instead of an IaaC setting?

1 Answers

The closest thing to what you are looking for is ECS Container Insights.

You enable that at the ECS cluster level in Terraform:

resource "aws_ecs_cluster" "cluster" {
  name = "my-cluster"

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