def _print_status(config):
    cfn = boto3.client('cloudformation')
    lmb = boto3.client('lambda')
    try:
        stack = cfn.describe_stacks(StackName=config['name'])['Stacks'][0]
    except botocore.exceptions.ClientError:
        print('{} has not been deployed yet.'.format(config['name']))
    else:
        print('{} is deployed!'.format(config['name']))
        print('  Function name: {}'.format(
            _get_from_stack(stack, 'Output', 'FunctionArn').split(':')[-1]))
        print('  S3 bucket: {}'.format(config['aws']['s3_bucket']))
        print('  Stages:')
        stages = list(config['stage_environments'].keys())
        stages.sort()
        plugin_status = {}
        for name, plugin in plugins.items():
            if name in config and hasattr(plugin, 'status'):
                statuses = plugin.status(config, stack)
                if statuses:
                    for s, status in statuses.items():
                        plugin_status.setdefault(s, []).append(status)
        for s in stages:
            fd = None
            try:
                fd = lmb.get_function(FunctionName=_get_from_stack(
                    stack, 'Output', 'FunctionArn'), Qualifier=s)
            except botocore.exceptions.ClientError:  # pragma: no cover
                continue
            v = ':{}'.format(fd['Configuration']['Version'])
            if s in plugin_status and len(plugin_status[s]) > 0:
                print('    {}{}: {}'.format(s, v,
                                            ' '.join(plugin_status[s])))
            else:
                print('    {}{}'.format(s, v))