CodePark/ questions / CloudWatch, logs & X-Ray
START PRACTICINGPRACTICE
Backend question · Cloud & AWS › CloudWatch, logs & X-Ray

You create a CloudWatch Logs log group without setting a retention period. What happens to the logs?

They are kept indefinitely, and you keep paying for their storage

The default retention is "never expire". So the logs are kept forever, and your storage bill keeps growing. Set a retention period on every log group, ideally in your IaC (infrastructure as code). If you need cheap long-term storage, export the logs to S3 yourself.

The option "They are archived to S3 Glacier after 90 days" is wrong: CloudWatch Logs never archives to Glacier automatically. "They are deleted after 30 days" is also wrong, because there is no default expiry.