Method: AwsKmsKeys#fetch_from_api

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

#fetch_from_apiObject



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

def fetch_from_api
  backend = BackendFactory.create(inspec_runner)
  @table = []
  pagination_opts = { limit: 1000 }
  loop do
    api_result = backend.list_keys(pagination_opts)
    @table += api_result.keys.map(&:to_h)
    break unless api_result.truncated
    pagination_opts = { marker: api_result.next_marker }
  end
end