def attach_principal_policy(policyName, principal, region=None, key=None, keyid=None, profile=None):
 try:
  conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
  conn.attach_principal_policy(policyName=policyName, principal=principal)
  return {'attached': True}
 except ClientError as e:
  return {'attached': False, 'error': salt.utils.boto3.get_error(e)}

def attach_principal_policy ( policyName , principal , region = None , key = None , keyid = None , profile = None ) : try : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) conn . attach_principal_policy ( policyName = policyName , principal = principal ) return { 'attached' : True } except ClientError as e : return { 'attached' : False , 'error' : salt . utils . boto3 . get_error ( e ) }
attach the specified policy to the specified principal returns {attached: true} if the policy was attached {attached: false} if the policy was not attached .