if (datetime.datetime.now() - start_time).seconds >= timeout:
logging.exception("Timeout waiting for sql instance to be ready")
return False
json_output = self._DescribeInstance(instance_id)
try:
state = json_output["DBInstances"][0]["DBInstanceStatus"]
pending_values = json_output["DBInstances"][0]["PendingModifiedValues"]
logging.info("Instance state: %s", state)
if pending_values:
logging.info("Pending values: %s", (str(pending_values)))
if state == "available" and not pending_values:
break
except:
logging.exception("Error attempting to read stdout. Creation failure.")