Sha256: 4837c37e536b1e1b359684b5a78c93d7a82de49c1aafca6680e1b24dd89e44db

Contents?: true

Size: 1001 Bytes

Versions: 17

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

17 entries across 17 versions & 1 rubygems

Version Path
aws_recon-0.2.17 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.16 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.15 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.14 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.13 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.12 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.11 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.10 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.9 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.8 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.7 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.6 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.5 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.4 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.3 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.2 lib/aws_recon/collectors/ssm.rb
aws_recon-0.2.1 lib/aws_recon/collectors/ssm.rb