Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'CreateDate': get_iso_string(user['CreateDate']),
'GroupList': user['GroupList'],
'InlinePolicies': user['UserPolicyList'],
'ManagedPolicies': [
{
"name": x['PolicyName'],
"arn": x['PolicyArn']
} for x in user['AttachedManagedPolicies']
],
'Path': user['Path'],
'UserId': user['UserId'],
'UserName': user['UserName']
}
user = modify(temp_user, output='camelized')
_conn_from_args(user, conn)
users.append(registry.build_out(flags, start_with=user, pass_datastructure=True, **conn))
return users
"ManagedPolicies": ...,
"MFADevices": ...,
"Path": ...,
"UserId": ...,
"UserName": ...,
"SigningCerts": ...
}
:param user: dict MUST contain the UserName and also a combination of either the ARN or the account_number
:param output: Determines whether keys should be returned camelized or underscored.
:param conn: dict containing enough information to make a connection to the desired account.
Must at least have 'assume_role' key.
:return: dict containing fully built out user.
"""
user = modify(user, output='camelized')
_conn_from_args(user, conn)
return registry.build_out(flags, start_with=user, pass_datastructure=True, **conn)
"Description": "...",
"CreateDate": "...",
"UpdateDate": "...",
"Document": "...",
"_version": 1
}
:param managed_policy: dict MUST contain the ARN.
:param flags:
:param conn:
:return:
"""
if not managed_policy.get('Arn'):
raise MissingFieldException('Must include Arn.')
_conn_from_args(managed_policy, conn)
return registry.build_out(flags, start_with=managed_policy, pass_datastructure=True, **conn)
"_version": 1
}
:param flags: By default, Users is disabled. This is somewhat expensive as it has to call the `get_group` call
multiple times.
:param group: dict MUST contain the GroupName and also a combination of either the ARN or the account_number.
:param output: Determines whether keys should be returned camelized or underscored.
:param conn: dict containing enough information to make a connection to the desired account.
Must at least have 'assume_role' key.
:return: dict containing fully built out Group.
"""
if not group.get('GroupName'):
raise MissingFieldException('Must include GroupName.')
group = modify(group, output='camelized')
_conn_from_args(group, conn)
return registry.build_out(flags, start_with=group, pass_datastructure=True, **conn)
"ManagedPolicies": ...,
"Path": ...,
"RoleId": ...,
"RoleName": ...,
"Tags": {},
"_version": 3
}
:param role: dict containing (at the very least) role_name and/or arn.
:param output: Determines whether keys should be returned camelized or underscored.
:param conn: dict containing enough information to make a connection to the desired account.
Must at least have 'assume_role' key.
:return: dict containing a fully built out role.
"""
role = modify(role, output='camelized')
_conn_from_args(role, conn)
return registry.build_out(flags, start_with=role, pass_datastructure=True, **conn)