Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'Arn': user['Arn'],
'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
"InstanceProfiles": ...,
"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)
"InlinePolicies": ...,
"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)
"Users": ..., # False by default -- these are just the names of the users.
"_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)
def decorated_function(*args, **kwargs):
output = kwargs.pop('output', 'camelized')
result = func(*args, **kwargs)
return modify(result, output=output)
return decorated_function
def modify(d, output='camelized'):
return cloudaux_modify(d, output=output)