CloudWatch Logs costs more than the EC2 fleet. What do you do?

IntermediateScenarioCost
Answer

Situation read → Logs ingestion is charged per GB ingested, and most of the bill is usually debug logs and a few chatty services.

What I'd do →

  1. Find the biggest log groups by IncomingBytes in CloudWatch metrics.
  2. Drop log levels to INFO in prod and remove noisy logs (health checks, per-request debug).
  3. Set retention on every log group; the default is "never expire".
aws logs put-retention-policy --log-group-name /eks/prod/app --retention-in-days 30
  1. Use the Infrequent Access log class for logs you rarely query.
  2. For high-volume app logs, ship to S3 (via Firehose) or a cheaper backend like Loki, and keep CloudWatch for AWS service logs and alerts.
  3. Add a Config rule or a CI check so new log groups must have retention.

Why → Ingestion is the cost driver, so reducing what you send beats reducing what you keep.

Interview tip → "Never expire is the default" is a detail interviewers like to hear.

All Real-World Interview questions Roadmap: Interview readiness

More on Cost