def wait_for_autoscale_state(instance: Instance, state: str) -> None:
    logger.info("Waiting for %s to reach autoscale lifecycle '%s'...", instance, state)
    while True:
        autoscale = instance.describe_autoscale()
        if (not autoscale):
            logger.error('Instance is not longer in an ASG: stopping')
            return
        cur_state = autoscale['LifecycleState']
        logger.debug('State is %s', cur_state)
        if (cur_state == state):
            logger.info('...done')
            return
        time.sleep(5)
def wait_for_autoscale_state(instance: Instance, state: str) -> None:
    logger.info("Waiting for %s to reach autoscale lifecycle '%s'...", instance, state)
    while True:
        autoscale = instance.describe_autoscale()
        if (not autoscale):
            logger.error('Instance is not longer in an ASG: stopping')
            return
        cur_state = autoscale['LifecycleState']
        logger.debug('State is %s', cur_state)
        if (cur_state == state):
            logger.info('...done')
            return
        time.sleep(5)