Method: AwsIamPolicies#fetch_from_api

Defined in:
lib/resources/aws/aws_iam_policies.rb

#fetch_from_apiObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/resources/aws/aws_iam_policies.rb', line 30

def fetch_from_api
  backend = BackendFactory.create(inspec_runner)
  @table = []
  pagination_opts = {}
  loop do
    api_result = backend.list_policies(pagination_opts)
    @table += api_result.policies.map(&:to_h)
    pagination_opts = { marker: api_result.marker }
    break unless api_result.is_truncated
  end
end