Skip to main content
A CloudWatch log group with no retention period keeps every log event forever, and you pay to store all of it. nOps finds log groups whose stored data keeps growing and never shrinks, and estimates the saving from deleting events older than a retention period, 90 days unless another is shown.

Why it matters

Log groups are created with no retention by default, so their storage grows every month and is rarely reviewed.

How nOps finds it

nOps flags a log group when its stored data grew in each of the last three 30-day periods and never shrank, so its events are kept indefinitely or for more than 90 days. The saving is the storage billed for data older than the recommended retention period, at the log group’s billed storage rate.

Before you start

Check audit, security and compliance requirements for how long the logs must be kept. Permission to set retention (logs:PutRetentionPolicy).

How to implement

  1. Confirm how long the logs must be kept, and export older events to S3 first if they must be kept longer.
  2. Check the current setting (aws logs describe-log-groups --log-group-name-prefix LOG_GROUP); no retentionInDays means never expire.
  3. Set the retention period (CloudWatch console: Log groups → your group → Actions → Edit retention setting, or aws logs put-retention-policy --log-group-name LOG_GROUP --retention-in-days 90).
  4. Set retention in Terraform, CloudFormation or the code that creates the group, so new groups get it too.

Risks and considerations

  • Events older than the retention period are deleted permanently, within about 72 hours.
  • If you also enable Intelligent Tiering, retention saves less, because old data is already billed at a lower rate. Do not add the two savings together.
  • To undo, remove the retention policy (aws logs delete-retention-policy). Events already deleted cannot be restored.

FAQs

It is the default nOps suggests. Choose the period your compliance rules require; a longer period saves less.