Menu

1 / 5

"Never expire" log groups: what survives when you delete a Lambda, and the account-level retention AWS added this week

DEV Community: cloud·Gonzalo Gjuka·1 day ago
#2j4odFLS
#devtocloud#devto#dev#retention#group
Reading 0:00
15s threshold

The note on what survives a VM has a serverless cousin: the log group. When a Lambda function is invoked for the first time, CloudWatch creates /aws/lambda/<name> with "Never expire" retention, and when you delete the function that log group does not go with it. The Lambda documentation says it in one line: "Log groups aren't deleted automatically when you delete a function". On November 9 AWS published account-level retention policies, the first way to put an expiry on all of them at once. Everything below comes from docs.aws.amazon.com and the pricing page; the sources are at the end.

Why it stays at "Never expire"

CloudWatch keeps log events indefinitely unless someone sets a retention; in the console that state is labelled "Never Expire". Lambda creates the log group for you, on the first invocation, with that value.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.