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



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

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

#get_trail_status(id) ⇒ Object



16
17
18
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 16

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

#get_trail_tags(arn) ⇒ Object



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

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)


26
27
28
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 26

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

#select_all_trailsObject



6
7
8
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 6

def select_all_trails
  cloudtrail_client.describe_trails.trail_list
end