Sha256: 233017251b6103327f4586cfa53ec32b9934e3eca8e888942bea55c735c31b04

Contents?: true

Size: 666 Bytes

Versions: 9

Compression:

Stored size: 666 Bytes

Contents

class SQS < Mapper
  #
  # Returns an array of resources.
  #
  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

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
aws_recon-0.2.9 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.8 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.7 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.6 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.5 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.4 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.3 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.2 lib/aws_recon/collectors/sqs.rb
aws_recon-0.2.1 lib/aws_recon/collectors/sqs.rb