def list_entities_for_policy(policy_name, path_prefix=None, entity_filter=None, region=None, key=None, keyid=None, profile=None):
 conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
 params = {}
 for arg in ('path_prefix', 'entity_filter'):
  if (locals()[arg] is not None):
   params[arg] = locals()[arg]
 policy_arn = _get_policy_arn(policy_name, region, key, keyid, profile)
 try:
  allret = {'policy_groups': [], 'policy_users': [], 'policy_roles': []}
  for ret in __utils__['boto.paged_call'](conn.list_entities_for_policy, policy_arn=policy_arn, **params):
   for (k, v) in six.iteritems(allret):
    v.extend(ret.get('list_entities_for_policy_response', {}).get('list_entities_for_policy_result', {}).get(k))
  return allret
 except boto.exception.BotoServerError as e:
  log.debug(e)
  msg = 'Failed to list {0} policy entities.'
  log.error(msg.format(policy_name))
  return {}

def list_entities_for_policy ( policy_name , path_prefix = None , entity_filter = None , region = None , key = None , keyid = None , profile = None ) : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) params = { } for arg in ( 'path_prefix' , 'entity_filter' ) : if ( locals ( ) [ arg ] is not None ) : params [ arg ] = locals ( ) [ arg ] policy_arn = _get_policy_arn ( policy_name , region , key , keyid , profile ) try : allret = { 'policy_groups' : [ ] , 'policy_users' : [ ] , 'policy_roles' : [ ] } for ret in __utils__ [ 'boto.paged_call' ] ( conn . list_entities_for_policy , policy_arn = policy_arn , ** params ) : for ( k , v ) in six . iteritems ( allret ) : v . extend ( ret . get ( 'list_entities_for_policy_response' , { } ) . get ( 'list_entities_for_policy_result' , { } ) . get ( k ) ) return allret except boto . exception . BotoServerError as e : log . debug ( e ) msg = 'Failed to list {0} policy entities.' log . error ( msg . format ( policy_name ) ) return { }
list entities that a policy is attached to .