def put_key_policy(key_id, policy_name, policy, region=None, key=None,
                   keyid=None, profile=None):
    '''
    Attach a key policy to the specified key.

    CLI example::

        salt myminion boto_kms.put_key_policy 'alias/mykey' default '{"Statement":...}'
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    r = {}
    try:
        conn.put_key_policy(key_id, policy_name, salt.serializers.json.serialize(policy))
        r['result'] = True
    except boto.exception.BotoServerError as e:
        r['result'] = False
        r['error'] = __utils__['boto.get_error'](e)
    return r
Attach a key policy to the specified key.

    CLI example::

        salt myminion boto_kms.put_key_policy 'alias/mykey' default '{"Statement":...}'