Giter Site home page Giter Site logo

Comments (5)

ncc-erik-steringer avatar ncc-erik-steringer commented on May 27, 2024

I hadn't noticed this API before. It definitely would knock out a bunch of the work that goes into the graphing portion. The only concern I have is scaling, but the API hints that pagination is available.

from pmapper.

danieladams456 avatar danieladams456 commented on May 27, 2024

Yeah, I had just been using the CLI before. Trying it with the API it really was 13 pages. Still not bad for 600 roles and associated policies.

Not the most elegant, but easy to reason about. All these accumulate independently over the pages.

def do_pull():
    # temporary accumulator variables
    UserDetailList = []
    GroupDetailList = []
    RoleDetailList = []
    Policies = []

    for res in iam.get_paginator('get_account_authorization_details').paginate():
        UserDetailList.extend(res['UserDetailList'])
        GroupDetailList.extend(res['GroupDetailList'])
        RoleDetailList.extend(res['RoleDetailList'])
        Policies.extend(res['Policies'])

    return {
        'UserDetailList': UserDetailList,
        'GroupDetailList': GroupDetailList,
        'RoleDetailList': RoleDetailList,
        'Policies': Policies,
    }

from pmapper.

ncc-erik-steringer avatar ncc-erik-steringer commented on May 27, 2024

Aiming to fix this with #36 and deploy the change in the next micro version.

from pmapper.

ncc-erik-steringer avatar ncc-erik-steringer commented on May 27, 2024

Looping back around here, I think I'm gonna aim to implement this now in v1.1.0 to address #41 since the iam:ListUsers API ain't gonna return it.

from pmapper.

ncc-erik-steringer avatar ncc-erik-steringer commented on May 27, 2024

Completed in 5828a87 for eventual release of v1.1.0.

from pmapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.