Hemanth
Hemanth

Reputation: 21

Stopping an RDS instance automatically with SNS notification

Can I stop an RDS instance automatically whenever it is restarted by using SNS notification which triggers a Lambda function instead of scheduled cron expressions in CloudWatch?

As I find automation only using CloudWatch events that check by the time specified in cron expression?

Am looking for a cost-effective and a standardized solution which stops an RDS instance as soon as it restarts because I want to stop it most of the time.

Upvotes: 1

Views: 743

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270224

As per Stopping an Amazon RDS DB Instance Temporarily - Amazon Relational Database Service:

You can stop a DB instance for up to seven days. If you do not manually start your DB instance after seven days, your DB instance is automatically started.

This is done to ensure that the RDS instance receives regular updates.

The Stop capability is not designed to have the database effective stopped all the time.

Yes, you probably could have SNS trigger a Lambda function that stops the database again, but it is not recommended.

Instead, it is recommended that you make a Snapshot of the database, then terminate it. When you require the database, you can launch a new RDS instance from the Snapshot.

Upvotes: 1

Related Questions