0

I have a mysql RDS instance that is used only from 9am to 9pm.

To avoid too much charges, I would like to stop it during the night, but I cannot do this because I have Multi-AZ active (I need it during server use).

Does it make sense to schedule this process?

@8:45pm:

  • disable multi-AZ
  • stop RDS instance

@8:45am:

  • start RDS instance
  • enable multi-AZ
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Cris
  • 12,124
  • 27
  • 92
  • 159
  • Why do you "need multi-AZ during server use", and yet do not need the database at night? What is your requirement for having multi-AZ during the day? – John Rotenstein Oct 16 '18 at 21:51
  • 1
    It's a web application that is used in physical stores that are opened only during the day. In the day i cannot risk the DB to be unreachable. – Cris Oct 17 '18 at 08:02

1 Answers1

3

Sounds like a good cost-cutting move.

You can create a lambda function (or two) that uses an AWS library (like boto3) to perform this disabling/enabling of multi-AZ and of your RDS instance.

Then, use CloudWatch Events to trigger the lambda function at the times you specify.

Sean Pianka
  • 2,157
  • 2
  • 27
  • 43