Skip to content

Instantly share code, notes, and snippets.

@tanmay-bhat
Last active January 10, 2023 15:06
Show Gist options
  • Save tanmay-bhat/7ba9887424ed4bca9851d6c9af396037 to your computer and use it in GitHub Desktop.
Save tanmay-bhat/7ba9887424ed4bca9851d6c9af396037 to your computer and use it in GitHub Desktop.
AWS CLI command to list all RDS snapshots older than 7 days :
aws rds describe-db-snapshots --query "DBSnapshots[?SnapshotCreateTime<='$(date -v-7d +%Y-%m-%dT%H:%M:%SZ)'].{DBSnapshotIdentifier:DBSnapshotIdentifier, DBInstanceIdentifier:DBInstanceIdentifier,SnapshotCreateTime:SnapshotCreateTime}" --region <region> --output table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment