Module: Awspec::Helper::Finder::Cloudtrail

Included in:
Awspec::Helper::Finder
Defined in:
lib/awspec/helper/finder/cloudtrail.rb

Instance Method Summary collapse

Instance Method Details

#find_trail(id) ⇒ Object



8
9
10
11
12
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 8

def find_trail(id)
  ret = cloudtrail_client.describe_trails.trail_list.find do |trail|
    trail.name == id
  end
end

#get_trail_status(id) ⇒ Object



14
15
16
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 14

def get_trail_status(id)
  cloudtrail_client.get_trail_status(name: id)
end

#get_trail_tags(arn) ⇒ Object



18
19
20
21
22
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 18

def get_trail_tags(arn)
  cloudtrail_client.list_tags(
    resource_id_list: [arn]
  )[:resource_tag_list].first[:tags_list]
end

#is_logging?(id) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 24

def is_logging?(id)
  ret = get_trail_status(id).is_logging
end

#select_all_trailsObject



4
5
6
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 4

def select_all_trails
  cloudtrail_client.describe_trails.trail_list
end