Sha256: 44da90350158efcd5097bebd64601ae549736dfd79d8b0081e530b1f0ea676ea

Contents?: true

Size: 1001 Bytes

Versions: 10

Compression:

Stored size: 1001 Bytes

Contents

class SSM < Mapper
  #
  # Returns an array of resources.
  #
  def collect
    resources = []

    #
    # describe_instance_information
    #
    @client.describe_instance_information.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.instance_information_list.each do |instance|
        struct = OpenStruct.new(instance.to_h)
        struct.type = 'instance'
        struct.arn = instance.instance_id

        resources.push(struct.to_h)
      end
    end

    #
    # describe_parameters
    #
    @client.describe_parameters.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.parameters.each do |parameter|
        struct = OpenStruct.new(parameter.to_h)
        struct.string_type = parameter.type
        struct.type = 'parameter'
        struct.arn = "arn:aws:#{@service}:#{@region}::parameter:#{parameter.name}"

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
aws_recon-0.2.27 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.26 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.25 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.24 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.23 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.22 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.21 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.20 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.19 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.18 lib/aws_recon/collectors/ssm.rb