-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix aws-iam-users pagination #2761
Conversation
PROBLEM: aws-iam-users resource only retrieves 100 records due to pagination in the AWS IAM list_users function. FIX: Iterate over all the pages using the AWS pagination variables `marker` and `is_truncated` Signed-off-by: Richard Nixon <[email protected]>
Rubocop: Assignment Branch Condition size for fetch_from_api is too high Rubocop: Space missing after colon Rubocop: Use Kernel#loop with break rather than begin/end/until(or while) Signed-off-by: Richard Nixon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much simpler than the approach I was going to take (in which list_users
may be treated as an iterator). Unfortunately this breaks the unit tests, though the fix is simple. Since list_users
is now being called with params, alter lines 106 and 131 of test/unit/resources/aws_iam_users_test.rb
to read def list_users(criteria = {})
(Thanks @clintoncwolfe) Signed-off-by: Richard Nixon <[email protected]>
Cheers @clintoncwolfe |
Thanks - looks great! I've borrowed your approach and applied it to several other resources. |
Sweet... that means I don't have to finish my generic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @trickyearlobe !
PROBLEM: aws-iam-users resource only retrieves 100 records due to pagination
in the AWS IAM list_users function.
FIX: Iterate over all the pages using the AWS pagination variables
marker
and
is_truncated
Fixes #2760 and part of #2582 (which concerns additional resources)
Signed-off-by: Richard Nixon [email protected]