Given a policy name, check to see if the given policy exists.

    Returns True if the given policy exists and returns False if the given
    policy does not exist.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iot.policy_exists mypolicy

def policy_exists(policyName,
           region=None, key=None, keyid=None, profile=None):
    '''
    Given a policy name, check to see if the given policy exists.

    Returns True if the given policy exists and returns False if the given
    policy does not exist.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iot.policy_exists mypolicy

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        conn.get_policy(policyName=policyName)
        return {'exists': True}
    except ClientError as e:
        err = __utils__['boto3.get_error'](e)
        if e.response.get('Error', {}).get('Code') == 'ResourceNotFoundException':
            return {'exists': False}
        return {'error': err}