How to use the cloudaux.orchestration.modify function in cloudaux

To help you get started, we’ve selected a few cloudaux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / iam / user.py View on Github external
'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
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / iam / role.py View on Github external
"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)
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / iam / user.py View on Github external
"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)
github Netflix-Skunkworks / cloudaux / cloudaux / orchestration / aws / iam / group.py View on Github external
"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)
github Netflix-Skunkworks / cloudaux / cloudaux / decorators.py View on Github external
def decorated_function(*args, **kwargs):
        output = kwargs.pop('output', 'camelized')
        result = func(*args, **kwargs)
        return modify(result, output=output)
    return decorated_function
github Netflix / security_monkey / security_monkey / common / gcp / util.py View on Github external
def modify(d, output='camelized'):
    return cloudaux_modify(d, output=output)