def create_role(name, policy_document=None, path=None, region=None, key=None, keyid=None, profile=None):
 conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
 if role_exists(name, region, key, keyid, profile):
  return True
 if (not policy_document):
  policy_document = None
 try:
  conn.create_role(name, assume_role_policy_document=policy_document, path=path)
  log.info('Created {0} iam role.'.format(name))
  return True
 except boto.exception.BotoServerError as e:
  log.error(e)
  msg = 'Failed to create {0} iam role.'
  log.error(msg.format(name))
  return False

def create_role ( name , policy_document = None , path = None , region = None , key = None , keyid = None , profile = None ) : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) if role_exists ( name , region , key , keyid , profile ) : return True if ( not policy_document ) : policy_document = None try : conn . create_role ( name , assume_role_policy_document = policy_document , path = path ) log . info ( 'Created {0} iam role.' . format ( name ) ) return True except boto . exception . BotoServerError as e : log . error ( e ) msg = 'Failed to create {0} iam role.' log . error ( msg . format ( name ) ) return False
create a new role .