awspec 1.5.4 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -3
- data/doc/_resource_types/firehose.md +31 -0
- data/doc/resource_types.md +45 -0
- data/lib/awspec/generator/doc/type/firehose.rb +17 -0
- data/lib/awspec/helper/finder.rb +3 -0
- data/lib/awspec/helper/finder/firehose.rb +13 -0
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/stub/firehose.rb +24 -0
- data/lib/awspec/type/firehose.rb +30 -0
- data/lib/awspec/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 466ac768eb0641720229a672cbae08730b832a11
|
4
|
+
data.tar.gz: 2decb9ea00922203f475721287df0db888702207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d32f2a91e41428d4b91abb9ef3b7a6771e973766258027577cdb6ecd755c1f7a8760ca03bb2457b0b0502276696ba67cbc2519f61b30ad09068dc5cdff1c7e13
|
7
|
+
data.tar.gz: 8e19b0c7223a42622d914a1ff4d9a690cdbdbcd1f47c26e4a11488a318e6b4094bc7c4176cf035d585d26b286b636886bf0b85ca42463869e1e81d2a121c9b0e
|
data/.rubocop.yml
CHANGED
@@ -41,6 +41,9 @@ Metrics/ModuleLength:
|
|
41
41
|
Metrics/PerceivedComplexity:
|
42
42
|
Max: 15
|
43
43
|
|
44
|
+
Naming/PredicateName:
|
45
|
+
Enabled: false
|
46
|
+
|
44
47
|
Performance/StringReplacement:
|
45
48
|
Enabled: false
|
46
49
|
|
@@ -80,9 +83,6 @@ Style/StabbyLambdaParentheses:
|
|
80
83
|
Style/PercentLiteralDelimiters:
|
81
84
|
Enabled: false
|
82
85
|
|
83
|
-
Style/PredicateName:
|
84
|
-
Enabled: false
|
85
|
-
|
86
86
|
Style/RedundantSelf:
|
87
87
|
Enabled: false
|
88
88
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
### exist
|
2
|
+
|
3
|
+
```ruby
|
4
|
+
describe firehose('my-firehose') do
|
5
|
+
it { should exist }
|
6
|
+
end
|
7
|
+
```
|
8
|
+
|
9
|
+
### be_active
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
describe firehose('my-firehose') do
|
13
|
+
it { should be_active }
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
### have_splunk_destination
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
describe firehose('my-firehose') do
|
21
|
+
it { should have_splunk_destination }
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
### advanced
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
describe firehose('my-firehose') do
|
29
|
+
its(:delivery_stream_type) { should be_eql('DirectPut') }
|
30
|
+
end
|
31
|
+
```
|
data/doc/resource_types.md
CHANGED
@@ -29,6 +29,7 @@
|
|
29
29
|
| [elasticsearch](#elasticsearch)
|
30
30
|
| [elastictranscoder_pipeline](#elastictranscoder_pipeline)
|
31
31
|
| [elb](#elb)
|
32
|
+
| [firehose](#firehose)
|
32
33
|
| [iam_group](#iam_group)
|
33
34
|
| [iam_policy](#iam_policy)
|
34
35
|
| [iam_role](#iam_role)
|
@@ -1295,6 +1296,50 @@ end
|
|
1295
1296
|
|
1296
1297
|
|
1297
1298
|
### its(:health_check_target), its(:health_check_interval), its(:health_check_timeout), its(:health_check_unhealthy_threshold), its(:health_check_healthy_threshold), its(:load_balancer_name), its(:dns_name), its(:canonical_hosted_zone_name), its(:canonical_hosted_zone_name_id), its(:backend_server_descriptions), its(:availability_zones), its(:subnets), its(:vpc_id), its(:security_groups), its(:created_time), its(:scheme)
|
1299
|
+
## <a name="firehose">firehose</a>
|
1300
|
+
|
1301
|
+
Firehose resource type.
|
1302
|
+
|
1303
|
+
### exist
|
1304
|
+
|
1305
|
+
```ruby
|
1306
|
+
describe firehose('my-firehose') do
|
1307
|
+
it { should exist }
|
1308
|
+
end
|
1309
|
+
```
|
1310
|
+
|
1311
|
+
|
1312
|
+
### be_active
|
1313
|
+
|
1314
|
+
```ruby
|
1315
|
+
describe firehose('my-firehose') do
|
1316
|
+
it { should be_active }
|
1317
|
+
end
|
1318
|
+
```
|
1319
|
+
|
1320
|
+
|
1321
|
+
### be_creating
|
1322
|
+
|
1323
|
+
### be_deleting
|
1324
|
+
|
1325
|
+
### have_splunk_destination
|
1326
|
+
|
1327
|
+
```ruby
|
1328
|
+
describe firehose('my-firehose') do
|
1329
|
+
it { should have_splunk_destination }
|
1330
|
+
end
|
1331
|
+
```
|
1332
|
+
|
1333
|
+
|
1334
|
+
### its(:delivery_stream_name), its(:delivery_stream_arn), its(:delivery_stream_status), its(:delivery_stream_type), its(:version_id), its(:create_timestamp), its(:last_update_timestamp), its(:source), its(:has_more_destinations)
|
1335
|
+
### :unlock: Advanced use
|
1336
|
+
|
1337
|
+
```ruby
|
1338
|
+
describe firehose('my-firehose') do
|
1339
|
+
its(:delivery_stream_type) { should be_eql('DirectPut') }
|
1340
|
+
end
|
1341
|
+
```
|
1342
|
+
|
1298
1343
|
## <a name="iam_group">iam_group</a>
|
1299
1344
|
|
1300
1345
|
IamGroup resource type.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Awspec::Generator
|
2
|
+
module Doc
|
3
|
+
module Type
|
4
|
+
class Firehose < Base
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@type_name = 'Firehose'
|
8
|
+
@type = Awspec::Type::Firehose.new('my-firehose')
|
9
|
+
@ret = @type.resource_via_client
|
10
|
+
@matchers = []
|
11
|
+
@ignore_matchers = []
|
12
|
+
@describes = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/awspec/helper/finder.rb
CHANGED
@@ -14,6 +14,7 @@ require 'awspec/helper/finder/s3'
|
|
14
14
|
require 'awspec/helper/finder/autoscaling'
|
15
15
|
require 'awspec/helper/finder/ebs'
|
16
16
|
require 'awspec/helper/finder/elb'
|
17
|
+
require 'awspec/helper/finder/firehose'
|
17
18
|
require 'awspec/helper/finder/lambda'
|
18
19
|
require 'awspec/helper/finder/iam'
|
19
20
|
require 'awspec/helper/finder/kms'
|
@@ -48,6 +49,7 @@ module Awspec::Helper
|
|
48
49
|
include Awspec::Helper::Finder::Ecr
|
49
50
|
include Awspec::Helper::Finder::Ecs
|
50
51
|
include Awspec::Helper::Finder::Efs
|
52
|
+
include Awspec::Helper::Finder::Firehose
|
51
53
|
include Awspec::Helper::Finder::SecurityGroup
|
52
54
|
include Awspec::Helper::Finder::Rds
|
53
55
|
include Awspec::Helper::Finder::Route53
|
@@ -81,6 +83,7 @@ module Awspec::Helper
|
|
81
83
|
ecr_client: Aws::ECR::Client,
|
82
84
|
ecs_client: Aws::ECS::Client,
|
83
85
|
efs_client: Aws::EFS::Client,
|
86
|
+
firehose_client: Aws::Firehose::Client,
|
84
87
|
rds_client: Aws::RDS::Client,
|
85
88
|
route53_client: Aws::Route53::Client,
|
86
89
|
s3_client: Aws::S3::Client,
|
data/lib/awspec/helper/type.rb
CHANGED
@@ -11,7 +11,7 @@ module Awspec
|
|
11
11
|
alb alb_listener alb_target_group ami autoscaling_group cloudtrail
|
12
12
|
cloudwatch_alarm cloudwatch_event directconnect_virtual_interface
|
13
13
|
ebs ec2 ecr_repository ecs_cluster ecs_container_instance ecs_service ecs_task_definition
|
14
|
-
efs elasticache elasticache_cache_parameter_group elasticsearch elb iam_group
|
14
|
+
efs elasticache elasticache_cache_parameter_group elasticsearch elb firehose iam_group
|
15
15
|
iam_policy iam_role iam_user kms lambda launch_configuration nat_gateway
|
16
16
|
network_acl network_interface nlb nlb_listener nlb_target_group
|
17
17
|
rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Aws.config[:firehose] = {
|
2
|
+
stub_responses: {
|
3
|
+
describe_delivery_stream: {
|
4
|
+
delivery_stream_description: {
|
5
|
+
delivery_stream_name: 'my-firehose',
|
6
|
+
delivery_stream_arn: 'arn:aws:firehose:partition-1:1234567890:deliverystream/my-firehose',
|
7
|
+
delivery_stream_status: 'ACTIVE',
|
8
|
+
delivery_stream_type: 'DirectPut',
|
9
|
+
version_id: '1',
|
10
|
+
destinations: [
|
11
|
+
{
|
12
|
+
destination_id: 'destination-001',
|
13
|
+
elasticsearch_destination_description: {}
|
14
|
+
},
|
15
|
+
{
|
16
|
+
destination_id: 'destination-002',
|
17
|
+
splunk_destination_description: {}
|
18
|
+
}
|
19
|
+
],
|
20
|
+
has_more_destinations: false
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class Firehose < ResourceBase
|
3
|
+
def initialize(name)
|
4
|
+
super
|
5
|
+
@delivery_stream_name = name
|
6
|
+
end
|
7
|
+
|
8
|
+
def resource_via_client
|
9
|
+
@resource_via_client ||= find_delivery_stream(@delivery_stream_name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def id
|
13
|
+
@id ||= @delivery_stream_name if resource_via_client
|
14
|
+
end
|
15
|
+
|
16
|
+
STATES = %w(ACTIVE CREATING DELETING)
|
17
|
+
|
18
|
+
STATES.each do |state|
|
19
|
+
define_method state.downcase + '?' do
|
20
|
+
resource_via_client.delivery_stream_status == state
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def has_splunk_destination?
|
25
|
+
resource_via_client.destinations.find do |dest|
|
26
|
+
dest.splunk_destination_description
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/awspec/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -242,6 +242,7 @@ files:
|
|
242
242
|
- doc/_resource_types/elasticsearch.md
|
243
243
|
- doc/_resource_types/elastictranscoder_pipeline.md
|
244
244
|
- doc/_resource_types/elb.md
|
245
|
+
- doc/_resource_types/firehose.md
|
245
246
|
- doc/_resource_types/iam_group.md
|
246
247
|
- doc/_resource_types/iam_policy.md
|
247
248
|
- doc/_resource_types/iam_role.md
|
@@ -321,6 +322,7 @@ files:
|
|
321
322
|
- lib/awspec/generator/doc/type/elasticsearch.rb
|
322
323
|
- lib/awspec/generator/doc/type/elastictranscoder_pipeline.rb
|
323
324
|
- lib/awspec/generator/doc/type/elb.rb
|
325
|
+
- lib/awspec/generator/doc/type/firehose.rb
|
324
326
|
- lib/awspec/generator/doc/type/iam_group.rb
|
325
327
|
- lib/awspec/generator/doc/type/iam_policy.rb
|
326
328
|
- lib/awspec/generator/doc/type/iam_role.rb
|
@@ -411,6 +413,7 @@ files:
|
|
411
413
|
- lib/awspec/helper/finder/elasticsearch.rb
|
412
414
|
- lib/awspec/helper/finder/elastictranscoder.rb
|
413
415
|
- lib/awspec/helper/finder/elb.rb
|
416
|
+
- lib/awspec/helper/finder/firehose.rb
|
414
417
|
- lib/awspec/helper/finder/iam.rb
|
415
418
|
- lib/awspec/helper/finder/kms.rb
|
416
419
|
- lib/awspec/helper/finder/lambda.rb
|
@@ -496,6 +499,7 @@ files:
|
|
496
499
|
- lib/awspec/stub/elasticsearch.rb
|
497
500
|
- lib/awspec/stub/elastictranscoder_pipeline.rb
|
498
501
|
- lib/awspec/stub/elb.rb
|
502
|
+
- lib/awspec/stub/firehose.rb
|
499
503
|
- lib/awspec/stub/iam_group.rb
|
500
504
|
- lib/awspec/stub/iam_policy.rb
|
501
505
|
- lib/awspec/stub/iam_role.rb
|
@@ -559,6 +563,7 @@ files:
|
|
559
563
|
- lib/awspec/type/elasticsearch.rb
|
560
564
|
- lib/awspec/type/elastictranscoder_pipeline.rb
|
561
565
|
- lib/awspec/type/elb.rb
|
566
|
+
- lib/awspec/type/firehose.rb
|
562
567
|
- lib/awspec/type/iam_group.rb
|
563
568
|
- lib/awspec/type/iam_policy.rb
|
564
569
|
- lib/awspec/type/iam_role.rb
|