Created
June 6, 2020 12:35
-
-
Save krismorte/19fe49055a36b04cd398a8924e34e95f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cluster = await rdsFunc.describeClusters(); | |
cluster.forEach(async (cluster)=>{ | |
var snaps = await rdsFunc.describeClustersManualSnapshot(cluster.DBClusterIdentifier) | |
if(snaps){ | |
snaps.forEach(async (snap)=>{ | |
var copyDate = dateFunc.minusDaysFromToday(daysBefore); | |
var snapshotDate = dateFunc.removeTimeFromDate(snap.SnapshotCreateTime); | |
if (copyDate == snapshotDate) { | |
var copy = await rdsFunc.deleteClusterSnapshot(snap.DBClusterSnapshotIdentifier) | |
console.log(copy+" Rds cluster snapshot deleted") | |
} | |
}) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment