Class: SSM
Overview
Collect SSM 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 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/aws_recon/collectors/ssm.rb', line 10 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}:#{@account}:parameter:#{parameter.name}" resources.push(struct.to_h) end end resources end |