Sha256: 5f4637f2a1ff884f9a3af3eef7555577932a1f71a3285098ab1f2a999bca76db
Contents?: true
Size: 1020 Bytes
Versions: 13
Compression:
Stored size: 1020 Bytes
Contents
class CloudTrail < Mapper # # Returns an array of resources. # def collect resources = [] # # describe_trails # @client.describe_trails.each_with_index do |response, page| log(response.context.operation_name, page) response.trail_list.each do |trail| # list_tags needs to call into home_region client = if @region != trail.home_region Aws::CloudTrail::Client.new({ region: trail.home_region }) else @client end struct = OpenStruct.new(trail.to_h) struct.tags = client.list_tags({ resource_id_list: [trail.trail_arn] }).resource_tag_list.first.tags_list struct.type = 'cloud_trail' struct.event_selectors = client.get_event_selectors({ trail_name: trail.name }).to_h struct.status = client.get_trail_status({ name: trail.name }).to_h struct.arn = trail.trail_arn resources.push(struct.to_h) end end resources end end
Version data entries
13 entries across 13 versions & 1 rubygems