aws-solutions / instance-scheduler-on-aws

A cross-account and cross-region solution that allows customers to automatically start and stop EC2 and RDS Instances
https://aws.amazon.com/solutions/implementations/instance-scheduler-on-aws/
Apache License 2.0
541 stars 264 forks source link

Report inability to start/stop multi-az RDS as WARNING? #477

Closed dvs001-ifs closed 4 months ago

dvs001-ifs commented 1 year ago

Describe the bug ERROR message is logged when the scheduler is unable to about stop multi-az RDS instances. If this is a limitation, then can scheduler log the message as a WARNING instead of an ERROR message?

Use case for keeping it in the schedule:

If the RDS is multi AZ, scheduler reports ERROR in logs and our alarms go off. Error I receive: Error stopping rds instance RDS:, (Shape is missing required key 'type': OrderedDict([('members', OrderedDict([('SourceRegion', OrderedDict([('shape', 'String'), ('documentation', '

The ID of the region that contains the source for the db instance.

')]))]))]))

Would be nice if inability to shutdown multi-AZ RDS instance is logged as a WARNING, since this is a known limitation of scheduler.

Version: 1.4.2

hearde commented 1 year ago

I'm not sure that everyone would agree that this is not an error. If you tag an instance with a schedule, you indicate your intention for it to be started/stopped according to that schedule. If instance scheduler cannot do that, that is a failure in the operation of the solution - though not a fatal one, since it can continue to schedule other resources. It might be surprising to other customers that instance scheduler would not consider that an error. Is there a reason you are unable to a) remove the tag from the instances you don't wish to schedule, or b) tag multi-az RDS instances with a schedule with a 24-hour running period (effectively a "no-action" schedule)?

However, we would like to explore improved reporting of failure conditions, and I believe that the error message for this specific issue is improved in v1.5.0:

Error stopping rds instance RDS:database-1-instance-1, (An error occurred (InvalidParameterCombination) when calling the StopDBInstance operation: You can’t stop a DB instance that is part of a Multi-AZ DB cluster.)
shujacks commented 4 months ago

Closing the issue since we decided to not implement. Please reach out again if you have more questions thanks.