def exists(
        name,
        region,
        user=None,
        opts=False):
    '''
    Ensure the SQS queue exists.

    name
        Name of the SQS queue.

    region
        Region to create the queue

    user
        Name of the user performing the SQS operations

    opts
        Include additional arguments and options to the aws command line
    '''
    ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}

    does_exist = __salt__['aws_sqs.queue_exists'](name, region, opts, user)

    if not does_exist:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'AWS SQS queue {0} is set to be created'.format(
                    name)
            return ret
        created = __salt__['aws_sqs.create_queue'](name, region, opts, user)
        if created['retcode'] == 0:
            ret['changes']['new'] = created['stdout']
        else:
            ret['result'] = False
            ret['comment'] = created['stderr']

    else:
        ret['comment'] = '{0} exists in {1}'.format(name, region)

    return ret
def exists ( name , region , user = None , opts = False ) : ret = { 'name' : name , 'result' : True , 'comment' : '' , 'changes' : { } } does_exist = __salt__ [ 'aws_sqs.queue_exists' ] ( name , region , opts , user ) if not does_exist : if __opts__ [ 'test' ] : ret [ 'result' ] = None ret [ 'comment' ] = 'AWS SQS queue {0} is set to be created' . format ( name ) return ret created = __salt__ [ 'aws_sqs.create_queue' ] ( name , region , opts , user ) if created [ 'retcode' ] == 0 : ret [ 'changes' ] [ 'new' ] = created [ 'stdout' ] else : ret [ 'result' ] = False ret [ 'comment' ] = created [ 'stderr' ] else : ret [ 'comment' ] = '{0} exists in {1}' . format ( name , region ) return ret
Ensure the SQS queue exists.

    name
        Name of the SQS queue.

    region
        Region to create the queue

    user
        Name of the user performing the SQS operations

    opts
        Include additional arguments and options to the aws command line