Schedule icon
Loop icon
AwsCLI icon
SlackIncomingWebhook icon

RDS Manual Snapshot Rotation Guard

Automate Amazon RDS manual snapshots with Kestra, nightly creation, retention-based pruning to cut storage costs, and Slack reporting.

Categories
Infrastructure

Manual RDS snapshots are the safety net every team wants and nobody maintains. Someone creates them before a migration, then they pile up for months, quietly adding to the AWS bill while nobody knows which ones are still needed. This blueprint turns snapshot hygiene into a scheduled, auditable flow.

How it works

  1. A Schedule trigger fires nightly at 01:00 UTC (shipped disabled so you can test first).
  2. A Loop task iterates over your db_instance_identifiers and creates one timestamped manual snapshot per instance via the AWS CLI.
  3. A pruning task lists manual snapshots per instance, compares SnapshotCreateTime against the retention cutoff, and deletes anything older.
  4. A Slack webhook posts the full run log so the team sees exactly what was created and deleted.

What you get

  • Exactly N days of restore points, never more, never fewer.
  • Lower RDS snapshot storage spend with zero manual cleanup.
  • A nightly audit trail in Slack showing every snapshot created and pruned.
  • Timestamped snapshot names (instance-20261017-0100) that sort chronologically.

Who it's for

Platform engineers, DBAs, and DevOps teams running Amazon RDS in production who are tired of paying for forgotten snapshots.

Why orchestrate this with Kestra

A cron job on one EC2 instance is invisible and unmonitored. As a Kestra flow you get retries on transient AWS API failures, per-task logs, execution history, and a single place where the whole team can see last night's rotation, plus inputs like retention_days editable without touching code.

Prerequisites

  • AWS credentials with rds:CreateDBSnapshot, rds:DeleteDBSnapshot, and rds:DescribeDBSnapshots permissions.
  • A Slack incoming webhook URL for the summary notification.

Secrets

  • AWS_ACCESS_KEY_ID: AWS access key for the RDS API calls.
  • AWS_SECRET_ACCESS_KEY: AWS secret key for the RDS API calls.
  • SLACK_WEBHOOK_URL: Incoming webhook URL for the run summary.

Quick start

  1. Add the three secrets above to your Kestra namespace.
  2. Set db_instance_identifiers to your RDS instances and retention_days to your policy (default 7).
  3. Run the flow manually once and check the Slack message.
  4. Enable the schedule trigger for nightly runs.

How to extend

  • Add a wait step (rds wait db-snapshot-available) before pruning for strict ordering.
  • Copy snapshots to a second region for disaster recovery with rds copy-db-snapshot.
  • Route failures to PagerDuty instead of Slack.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.