ECS Agent
Overview
Section titled “Overview”- Runs as a Daemon (EC2) or sidecar container (Fargate) alongside your workloads.
- Tracks task definitions, services, capacity providers, CPU/memory reservations, and CloudWatch usage.
- Emits spend per task, service, environment, and tenant labels so you can compare EC2 vs Fargate costs.
Installation
Section titled “Installation”- Daemon scheduling: create a dedicated ECS service with
DAEMONstrategy so one agent runs on every container instance. - Sidecar: add the agent container to existing Fargate task definitions with
essential: false. - Permissions: attach an IAM policy allowing
ecs:Describe*,cloudwatch:GetMetricData, andpricing:GetProducts.
Configuration
Section titled “Configuration”| ENV / Flag | Description |
|---|---|
CLUSTERCOST_CLUSTER | Human-friendly name for charts and SaaS aggregation. |
CLUSTERCOST_SERVICE | Optional override to tag spend with a logical service name. |
AWS_REGION | Region used when querying CloudWatch/Pricing endpoints. |
TENANT_LABELS | Comma-separated metadata (team, project, client) forwarded to the dashboard/SaaS. |
Use secrets or task definition environment overrides for sensitive data such as API tokens or custom endpoints.