Class: SQS
Overview
Collect SQS resources
Constant Summary
Constants inherited from Mapper
Mapper::SINGLE_REGION_SERVICES
Instance Method Summary collapse
-
#collect ⇒ Object
Returns an array of resources.
Methods inherited from Mapper
Constructor Details
This class inherits a constructor from Mapper
Instance Method Details
#collect ⇒ Object
Returns an array of resources.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/aws_recon/collectors/sqs.rb', line 10 def collect resources = [] # # list_queues # @client.list_queues.each_with_index do |response, page| log(response.context.operation_name, page) response.queue_urls.each do |queue| log(response.context.operation_name, queue.downcase.split('/').last, page) # get_queue_attributes struct = OpenStruct.new(@client.get_queue_attributes({ queue_url: queue, attribute_names: ['All'] }).attributes.to_h) struct.type = 'queue' struct.arn = struct.QueueArn struct.policy = struct.Policy ? struct.delete_field('Policy').parse_policy : nil resources.push(struct.to_h) end end resources end |