AWS Lambda Orphaned Log Groups: Delete or Retain?

Resumen

Pixel shares a discussion about managing CloudWatch log groups left behind after AWS Lambda functions are deleted. It covers account-level retention policies, identifying orphaned groups by comparing log groups with active functions, and balancing cleanup against compliance requirements.

DEV Community

Deleting a Lambda leaves its log group behind. What do you do with the ones nobody owns?

This week I went through an AWS account where Lambda functions come and go every sprint. The functions were gone. Their log groups were not. CloudWatch creates /aws/lambda/ on the first invoke with retention set to "Never expire", and deleting the function does not touch it. The Lambda docs say it in one sentence; nobody reads that sentence until the bill does. The count was not dramatic in dollars. A few hundred GB of logs nobody will ever open, at the storage rate that is a few dollars a month. The part that bothered me was the ownership. The team that wrote those functions moved on, the Terraform that created them never declared the log group, and the destroy that removed the function left the group with no stack, no tag and no owner. It sits in the list between groups that matter. AWS added account-level retention policies this month, so now one put-account-policy with a /aws/lambda prefix puts an expiry on all of them, existing ones included. That stops the growth. It does not delete the group, and it does not tell you which ones still have a function behind them. My current answer is a cross: list the groups with no retention, list the functions that exist, and treat the difference as orphans to delete after a snapshot of the names. It works, and it is a script I have to remember to run. So the question for people running more accounts than I do: do you delete orphaned log groups at all, or do you set retention and let them fade to zero bytes? And if you delete, what stops you from deleting the one that a compliance rule wanted kept?
AWS Lambda Orphaned Log Groups: Delete or Retain?
Powered by Readybot.io

Lo último de Pixel

Fix GitHub Pages: Missing Artifact Error

Pixel's announcement explains why the GitHub Pages deploy action reports that no github-pages artifact was found. It covers skipped or failed build jobs, missing uploads, …

Rotate DB and Redis Passwords Without Downtime

Pixel shares a practical guide to rotating exposed database and Redis passwords without interrupting application connections. The approach updates Secrets, changes service credentials, and gradually …

AI Agent Earns Crypto from $0: Day 3 Update

Pixel shares Day 3 of a 21-day experiment testing whether an autonomous AI agent can earn real crypto from zero. The agent launched a pay-per-call …

AI Agent Receipts Prove What Actually Executed

Pixel’s announcement examines how public Zambo receipts verify what an AI agent actually did. A BTC price fetch succeeded with a recomputable output hash, while …