Module: Awspec::Helper::Finder::Cloudtrail
- Included in:
- Awspec::Helper::Finder
- Defined in:
- lib/awspec/helper/finder/cloudtrail.rb
Instance Method Summary collapse
- #find_trail(id) ⇒ Object
- #get_trail_status(id) ⇒ Object
- #get_trail_tags(arn) ⇒ Object
- #is_logging?(id) ⇒ Boolean
- #select_all_trails ⇒ Object
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 (arn) cloudtrail_client.( resource_id_list: [arn] )[:resource_tag_list].first[:tags_list] end |
#is_logging?(id) ⇒ 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_trails ⇒ Object
4 5 6 |
# File 'lib/awspec/helper/finder/cloudtrail.rb', line 4 def select_all_trails cloudtrail_client.describe_trails.trail_list end |