AWS RDS snapshot backup and restore in cross account's

Job ID: 35314453

Budget: ₹1,500 – ₹12,500 INR

The first, lambda function runs in the Live account on a daily basis. It deletes any snapshot copies left over from the previous day's run in Manual and creates a new manual copy of the most recent Automated snapshot for each RDS instance, shares it with the Failsafe account and sends an SNS alert to indicate that the snapshot is available.

The second function, runs in the Failsafe account and is triggered on receipt of the SNS alert. It takes a manual copy of the newly shared snapshot and deletes any existing snapshots that are older than a set age.

Task -

1) Currently copying RDS snapshots process form Automated to Manual is working fine but we are seeing one challenge, the lambda function run out of time (15 min) therefore all DB snapshots not completed within the time. So decided to run Lambda function daily 4 times so that if any DB snapshot not copied due to lambda timeout it will start copying only those DB snapshot on the next function run.
Note- we have 5 RDS Database.

2) Create new lambda function in Failsafe account which will restore the RDS instance every month from the latest Manual Snapshot copy created and shared by above Lambda function.
The database name and its configuration should match exactly the same after restoring.
Once restore completed and DB available its should send email or slack notification