awspec 0.45.0 → 0.46.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f921cf684604412caaa4006e719f5678b649b8b7
4
- data.tar.gz: b142ec92301b724468289160753fdf265b97d52c
3
+ metadata.gz: 0f7b5b4788484ec4a2f9524278b090b04d9cd251
4
+ data.tar.gz: cb5f51f033ed5264cd54594136f647a1eebfea65
5
5
  SHA512:
6
- metadata.gz: d29020c166fc765e536d77709e98ff45574ba414ebb2cc73d62f1630597f7bf69592ee2e52cc009ac340773a18566ed94fbcee3fc4defb2ca8ec10b58130ee72
7
- data.tar.gz: cda323ba6548e84e06151e36d01ea6a966f1837b0ade67e2f4f872df8a61632501594ea3abf80e35317f3351dfe481764dafd887ea97f89b525d6f928e427523
6
+ metadata.gz: 15bbe8871911a5750a287191f878c075ca1b7b9cfc6b171d5165ec84c698df8ec001907eeff5196e78ce63880adbb6e44d10968e9883d48f03dcbe794050c831
7
+ data.tar.gz: 40cf9036a8e6fcaf673e22ceb185389d1e1aa7a5c605050898aff31e56204537bc6be6e1d64650987e2e62ce9ca615f3f6b47b16707ca4b4bd93e2082bc95d96
@@ -0,0 +1,31 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe cloudtrail('my-trail') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### include_global_service_events
10
+
11
+ ```ruby
12
+ describe cloudtrail('my-trail') do
13
+ it { should include_global_service_events }
14
+ end
15
+ ```
16
+
17
+ ### be_multi_region_trail
18
+
19
+ ```ruby
20
+ describe cloudtrail('my-trail') do
21
+ it { should be_multi_region_trail }
22
+ end
23
+ ```
24
+
25
+ ### have_log_file_validation_enabled
26
+
27
+ ```ruby
28
+ describe cloudtrail('my-trail') do
29
+ it { should have_log_file_validation_enabled }
30
+ end
31
+ ```
@@ -2,6 +2,7 @@
2
2
 
3
3
  [ami](#ami)
4
4
  | [autoscaling_group](#autoscaling_group)
5
+ | [cloudtrail](#cloudtrail)
5
6
  | [cloudwatch_alarm](#cloudwatch_alarm)
6
7
  | [directconnect_virtual_interface](#directconnect_virtual_interface)
7
8
  | [ebs](#ebs)
@@ -89,6 +90,39 @@ end
89
90
  ```
90
91
 
91
92
  ### its(:auto_scaling_group_name), its(:auto_scaling_group_arn), its(:launch_configuration_name), its(:min_size), its(:max_size), its(:desired_capacity), its(:default_cooldown), its(:health_check_type), its(:health_check_grace_period), its(:created_time), its(:placement_group), its(:vpc_zone_identifier), its(:status), its(:new_instances_protected_from_scale_in)
93
+ ## <a name="cloudtrail">cloudtrail</a>
94
+
95
+ Cloudtrail resource type.
96
+
97
+ ### exist
98
+
99
+ ```ruby
100
+ describe cloudtrail('my-trail') do
101
+ it { should exist }
102
+ end
103
+ ```
104
+
105
+
106
+ ### be_multi_region_trail
107
+
108
+ ```ruby
109
+ describe cloudtrail('my-trail') do
110
+ it { should be_multi_region_trail }
111
+ end
112
+ ```
113
+
114
+
115
+ ### have_global_service_events_included
116
+
117
+ ### have_log_file_validation_enabled
118
+
119
+ ```ruby
120
+ describe cloudtrail('my-trail') do
121
+ it { should have_log_file_validation_enabled }
122
+ end
123
+ ```
124
+
125
+ ### its(:name), its(:s3_bucket_name), its(:s3_key_prefix), its(:sns_topic_name), its(:include_global_service_events), its(:is_multi_region_trail), its(:home_region), its(:trail_arn), its(:log_file_validation_enabled), its(:cloud_watch_logs_log_group_arn), its(:cloud_watch_logs_role_arn), its(:kms_key_id)
92
126
  ## <a name="cloudwatch_alarm">cloudwatch_alarm</a>
93
127
 
94
128
  CloudwatchAlarm resource type.
@@ -0,0 +1,17 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class Cloudtrail < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'Cloudtrail'
8
+ @type = Awspec::Type::Cloudtrail.new('my-trail')
9
+ @ret = @type.resource_via_client
10
+ @matchers = []
11
+ @ignore_matchers = []
12
+ @describes = []
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -18,6 +18,7 @@ require 'awspec/helper/finder/directconnect'
18
18
  require 'awspec/helper/finder/ami'
19
19
  require 'awspec/helper/finder/cloudfront'
20
20
  require 'awspec/helper/finder/elastictranscoder'
21
+ require 'awspec/helper/finder/cloudtrail'
21
22
 
22
23
  module Awspec::Helper
23
24
  module Finder
@@ -40,6 +41,7 @@ module Awspec::Helper
40
41
  include Awspec::Helper::Finder::Ami
41
42
  include Awspec::Helper::Finder::Cloudfront
42
43
  include Awspec::Helper::Finder::Elastictranscoder
44
+ include Awspec::Helper::Finder::Cloudtrail
43
45
 
44
46
  CLIENTS = {
45
47
  ec2_client: Aws::EC2::Client,
@@ -55,7 +57,8 @@ module Awspec::Helper
55
57
  ses_client: Aws::SES::Client,
56
58
  directconnect_client: Aws::DirectConnect::Client,
57
59
  cloudfront_client: Aws::CloudFront::Client,
58
- elastictranscoder_client: Aws::ElasticTranscoder::Client
60
+ elastictranscoder_client: Aws::ElasticTranscoder::Client,
61
+ cloudtrail_client: Aws::CloudTrail::Client
59
62
  }
60
63
 
61
64
  CLIENTS.each do |method_name, client|
@@ -0,0 +1,15 @@
1
+ module Awspec::Helper
2
+ module Finder
3
+ module Cloudtrail
4
+ def select_all_trails
5
+ cloudtrail_client.describe_trails.trail_list
6
+ end
7
+
8
+ def find_trail(id)
9
+ ret = cloudtrail_client.describe_trails.trail_list.find do |trail|
10
+ trail.name == id
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -4,7 +4,7 @@ module Awspec
4
4
  require 'awspec/type/base'
5
5
 
6
6
  TYPES = %w(
7
- ami autoscaling_group cloudwatch_alarm directconnect_virtual_interface
7
+ ami autoscaling_group cloudtrail cloudwatch_alarm directconnect_virtual_interface
8
8
  ebs ec2 elasticache elasticache_cache_parameter_group elb iam_group
9
9
  iam_policy iam_role iam_user lambda launch_configuration nat_gateway
10
10
  network_acl network_interface rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
@@ -0,0 +1,14 @@
1
+ Aws.config[:cloudtrail] = {
2
+ stub_responses: {
3
+ describe_trails: {
4
+ trail_list: [
5
+ {
6
+ name: 'my-trail',
7
+ include_global_service_events: true,
8
+ is_multi_region_trail: true,
9
+ log_file_validation_enabled: true
10
+ }
11
+ ]
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,23 @@
1
+ module Awspec::Type
2
+ class Cloudtrail < Base
3
+ aws_resource Aws::CloudTrail
4
+
5
+ def initialize(id)
6
+ super
7
+ @resource_via_client = find_trail(id)
8
+ @id = @resource_via_client.name if @resource_via_client
9
+ end
10
+
11
+ def has_global_service_events_included?
12
+ @resource_via_client.include_global_service_events
13
+ end
14
+
15
+ def multi_region_trail?
16
+ @resource_via_client.is_multi_region_trail
17
+ end
18
+
19
+ def has_log_file_validation_enabled?
20
+ @resource_via_client.log_file_validation_enabled
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.45.0'
2
+ VERSION = '0.46.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.45.0
4
+ version: 0.46.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-13 00:00:00.000000000 Z
11
+ date: 2016-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -203,6 +203,7 @@ files:
203
203
  - doc/_resource_types/ami.md
204
204
  - doc/_resource_types/autoscaling_group.md
205
205
  - doc/_resource_types/cloudfront_distribution.md
206
+ - doc/_resource_types/cloudtrail.md
206
207
  - doc/_resource_types/cloudwatch_alarm.md
207
208
  - doc/_resource_types/directconnect_virtual_interface.md
208
209
  - doc/_resource_types/ebs.md
@@ -246,6 +247,7 @@ files:
246
247
  - lib/awspec/generator/doc/type/autoscaling_group.rb
247
248
  - lib/awspec/generator/doc/type/base.rb
248
249
  - lib/awspec/generator/doc/type/cloudfront_distribution.rb
250
+ - lib/awspec/generator/doc/type/cloudtrail.rb
249
251
  - lib/awspec/generator/doc/type/cloudwatch_alarm.rb
250
252
  - lib/awspec/generator/doc/type/directconnect_virtual_interface.rb
251
253
  - lib/awspec/generator/doc/type/ebs.rb
@@ -300,6 +302,7 @@ files:
300
302
  - lib/awspec/helper/finder/ami.rb
301
303
  - lib/awspec/helper/finder/autoscaling.rb
302
304
  - lib/awspec/helper/finder/cloudfront.rb
305
+ - lib/awspec/helper/finder/cloudtrail.rb
303
306
  - lib/awspec/helper/finder/cloudwatch.rb
304
307
  - lib/awspec/helper/finder/directconnect.rb
305
308
  - lib/awspec/helper/finder/ebs.rb
@@ -343,6 +346,7 @@ files:
343
346
  - lib/awspec/stub/ami.rb
344
347
  - lib/awspec/stub/autoscaling_group.rb
345
348
  - lib/awspec/stub/cloudfront_distribution.rb
349
+ - lib/awspec/stub/cloudtrail.rb
346
350
  - lib/awspec/stub/cloudwatch_alarm.rb
347
351
  - lib/awspec/stub/directconnect_virtual_interface.rb
348
352
  - lib/awspec/stub/duplicated_resource_type.rb
@@ -376,6 +380,7 @@ files:
376
380
  - lib/awspec/type/autoscaling_group.rb
377
381
  - lib/awspec/type/base.rb
378
382
  - lib/awspec/type/cloudfront_distribution.rb
383
+ - lib/awspec/type/cloudtrail.rb
379
384
  - lib/awspec/type/cloudwatch_alarm.rb
380
385
  - lib/awspec/type/directconnect_virtual_interface.rb
381
386
  - lib/awspec/type/ebs.rb