AwsCLI icon
If icon
SlackIncomingWebhook icon
Schedule icon

AWS CloudWatch Log Group Indefinite Retention and Cost Leak Sentinel

Audits AWS CloudWatch log groups to detect indefinite retention policies causing uncontrolled storage cost accumulation.

Categories
BusinessCloud

How it works

This workflow uses the official AWS CLI plugin to query AWS CloudWatch Logs across the specified region. It searches for all log groups lacking an explicit retentionInDays setting (which default to Never Expire). It calculates total stored bytes across unmanaged log groups and alerts the FinOps team via Slack when unexpiring log groups exceed the policy threshold.

What you get

  • Proactive discovery of abandoned and unbudgeted log groups.
  • Prevents runaway AWS CloudWatch storage billing overhead.
  • Exact breakdown of total stored bytes and top offending log groups.

Who it's for

  • Cloud Financial Operations (FinOps) and Platform Engineers controlling AWS infrastructure spend.
  • DevOps engineers enforcing organization-wide log lifecycle policies.

Why orchestrate this with Kestra

  • Native AWS Integration: Uses official io.kestra.plugin.aws.cli.AwsCLI with secure credentials injection.
  • Scheduled Governance: Run weekly or monthly cost hygiene audits automatically.
  • Automated Enforcement: Easily extend the workflow with aws logs put-retention-policy to remediate automatically.

Prerequisites

  • AWS IAM credentials with logs:DescribeLogGroups permissions.
  • Secrets AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import this blueprint into Kestra.
  2. Configure AWS credentials and Slack webhook secret.
  3. Execute the workflow to audit CloudWatch log retention in your AWS account.

How to extend

  • Add an automated remediation branch to apply a default 30-day retention to non-compliant log groups.
  • Iterate across all AWS regions dynamically using a loop task.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.