lib/awspec/helper/finder/iam.rb in awspec-1.18.2 vs lib/awspec/helper/finder/iam.rb in awspec-1.18.3
- old
+ new
@@ -10,11 +10,16 @@
res = iam_client.send('list_' + type.pluralize)
loop do
selected += res[type.pluralize].select do |u|
u[type + '_name'] == id || u[type + '_id'] == id || u.arn == id
end
- (res.next_page? && res = res.next_page) || break
+
+ break unless res.is_truncated
+ res = iam_client.send(
+ 'list_' + type.pluralize,
+ { marker => res.marker }
+ )
end
selected.single_resource(id)
end
end
@@ -60,10 +65,13 @@
selected = []
res = iam_client.list_policies
loop do
selected += res.policies.select { |p| p.attachment_count > 0 }
- (res.next_page? && res = res.next_page) || break
+ break unless res.is_truncated
+ res = iam_client.list_policies({
+ marker: res.marker
+ })
end
selected
end