awspec 0.68.0 → 0.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b54ccb76f4f7552af0669f8601aef1613b3a8a56
4
- data.tar.gz: 9c6e25842c3214e6df98a7707e7331bc66511f43
3
+ metadata.gz: bdd48523a04e8dd27222aaf6402f407b47facb36
4
+ data.tar.gz: 2275b39f64331ad9c856d1085cb7b397ef68e780
5
5
  SHA512:
6
- metadata.gz: c82ae09fa349e9fda1b0b91c31c0398ff98d42f65c8500bd194a5f8bcd36f73884da6c8f2d69d9fcbbcb6d549b6bc6029515ed81f6799d428827359d10866494
7
- data.tar.gz: d8071de75c566361e665d87a6a9ab78815c45a063a31eef5b944bb2ba6d1dc4770f63ef90324da625b77bbcaf373ce1d35abbcf100f5addcb44f3161606a32cc
6
+ metadata.gz: 0a5acf19637ffc777ec7828b84c8702a5ed9ae13478d102415097717de3cb67a2de7a293ac5d67be9a01b7ba3238fc88025c349912e5435d91e1da5b1538c392
7
+ data.tar.gz: d1f8d7d99d88feb534181ab0f4cc65183cdcaaf96a930abf1c08ba70e2dd1182bb565416344da1d2fe785d859a9a5b6a8fc7a8cd54dbeda304baa49782fdaa7e
@@ -0,0 +1,15 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe acm('example.com') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### be_issued
10
+
11
+ ```ruby
12
+ describe acm('example.com') do
13
+ it { should be_issued }
14
+ end
15
+ ```
@@ -46,6 +46,7 @@
46
46
  | [vpn_gateway](#vpn_gateway)
47
47
  | [vpn_connection](#vpn_connection)
48
48
  | [internet_gateway](#internet_gateway)
49
+ | [acm](#acm)
49
50
 
50
51
  ## <a name="alb">alb</a>
51
52
 
@@ -2216,3 +2217,19 @@ end
2216
2217
  ```
2217
2218
 
2218
2219
  ### its(:internet_gateway_id)
2220
+ ## <a name="acm">acm</a>
2221
+
2222
+ Acm resource type.
2223
+
2224
+ ### exist
2225
+
2226
+ ```ruby
2227
+ describe acm('example.com') do
2228
+ it { should exist }
2229
+ end
2230
+ ```
2231
+
2232
+
2233
+ ### be_pending_validation, be_issued, be_inactive, be_expired, be_validation_timed_out, be_revoked, be_failed
2234
+
2235
+ ### its(:certificate_arn), its(:domain_name), its(:subject_alternative_names), its(:domain_validation_options), its(:serial), its(:subject), its(:issuer), its(:created_at), its(:issued_at), its(:imported_at), its(:status), its(:revoked_at), its(:revocation_reason), its(:not_before), its(:not_after), its(:key_algorithm), its(:signature_algorithm), its(:in_use_by), its(:failure_reason), its(:type), its(:renewal_summary)
@@ -0,0 +1,19 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class Acm < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'Acm'
8
+ @type = Awspec::Type::Acm.new('example.com')
9
+ @ret = @type.resource_via_client
10
+ @matchers = [
11
+ Awspec::Type::Acm::STATUSES.map { |status| 'be_' + status.downcase }.join(', ')
12
+ ]
13
+ @ignore_matchers = Awspec::Type::Acm::STATUSES.map { |status| 'be_' + status.downcase }
14
+ @describes = []
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -27,6 +27,7 @@ require 'awspec/helper/finder/cloudfront'
27
27
  require 'awspec/helper/finder/elastictranscoder'
28
28
  require 'awspec/helper/finder/cloudtrail'
29
29
  require 'awspec/helper/finder/waf'
30
+ require 'awspec/helper/finder/acm'
30
31
 
31
32
  module Awspec::Helper
32
33
  module Finder
@@ -58,6 +59,7 @@ module Awspec::Helper
58
59
  include Awspec::Helper::Finder::Elastictranscoder
59
60
  include Awspec::Helper::Finder::Cloudtrail
60
61
  include Awspec::Helper::Finder::Waf
62
+ include Awspec::Helper::Finder::Acm
61
63
 
62
64
  CLIENTS = {
63
65
  ec2_client: Aws::EC2::Client,
@@ -82,7 +84,8 @@ module Awspec::Helper
82
84
  elastictranscoder_client: Aws::ElasticTranscoder::Client,
83
85
  elasticsearch_client: Aws::ElasticsearchService::Client,
84
86
  cloudtrail_client: Aws::CloudTrail::Client,
85
- waf_client: Aws::WAF::Client
87
+ waf_client: Aws::WAF::Client,
88
+ acm_client: Aws::ACM::Client
86
89
  }
87
90
 
88
91
  CLIENTS.each do |method_name, client|
@@ -0,0 +1,10 @@
1
+ module Awspec::Helper
2
+ module Finder
3
+ module Acm
4
+ def find_certificate(domain)
5
+ cert = acm_client.list_certificates.certificate_summary_list.find { |c| c[:domain_name] == domain }
6
+ acm_client.describe_certificate({ certificate_arn: cert.certificate_arn }).certificate
7
+ end
8
+ end
9
+ end
10
+ end
@@ -10,7 +10,7 @@ module Awspec
10
10
  iam_policy iam_role iam_user kms lambda launch_configuration nat_gateway
11
11
  network_acl network_interface rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
12
12
  route_table s3_bucket security_group ses_identity subnet vpc cloudfront_distribution
13
- elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection internet_gateway
13
+ elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection internet_gateway acm
14
14
  )
15
15
 
16
16
  TYPES.each do |type|
@@ -0,0 +1,20 @@
1
+ Aws.config[:acm] = {
2
+ stub_responses: {
3
+ list_certificates: {
4
+ certificate_summary_list: [
5
+ {
6
+ certificate_arn: 'arn:aws:acm:region:123456789010:certificate/12345678-1234-1234-1234-123456789010',
7
+ domain_name: 'example.com'
8
+ }
9
+ ]
10
+ },
11
+ describe_certificate: {
12
+ certificate: {
13
+ certificate_arn: 'arn:aws:acm:region:123456789010:certificate/12345678-1234-1234-1234-123456789010',
14
+ domain_name: 'example.com',
15
+ status: 'ISSUED',
16
+ type: 'AMAZON_ISSUED'
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,27 @@
1
+ module Awspec::Type
2
+ class Acm < Base
3
+ def resource_via_client
4
+ @resource_via_client ||= find_certificate(@display_name)
5
+ end
6
+
7
+ def id
8
+ @id = resource_via_client.certificate_arn if resource_via_client
9
+ end
10
+
11
+ STATUSES = %w(
12
+ PENDING_VALIDATION
13
+ ISSUED
14
+ INACTIVE
15
+ EXPIRED
16
+ VALIDATION_TIMED_OUT
17
+ REVOKED
18
+ FAILED
19
+ )
20
+
21
+ STATUSES.each do |status|
22
+ define_method status.downcase + '?' do
23
+ resource_via_client.status == status
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.68.0'
2
+ VERSION = '0.69.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.68.0
4
+ version: 0.69.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2017-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -206,6 +206,7 @@ files:
206
206
  - bin/console
207
207
  - bin/setup
208
208
  - bin/toolbox
209
+ - doc/_resource_types/acm.md
209
210
  - doc/_resource_types/alb.md
210
211
  - doc/_resource_types/ami.md
211
212
  - doc/_resource_types/autoscaling_group.md
@@ -262,6 +263,7 @@ files:
262
263
  - lib/awspec/ext/struct.rb
263
264
  - lib/awspec/generator.rb
264
265
  - lib/awspec/generator/doc/type.rb
266
+ - lib/awspec/generator/doc/type/acm.rb
265
267
  - lib/awspec/generator/doc/type/alb.rb
266
268
  - lib/awspec/generator/doc/type/ami.rb
267
269
  - lib/awspec/generator/doc/type/autoscaling_group.rb
@@ -337,6 +339,7 @@ files:
337
339
  - lib/awspec/helper.rb
338
340
  - lib/awspec/helper/color.rb
339
341
  - lib/awspec/helper/finder.rb
342
+ - lib/awspec/helper/finder/acm.rb
340
343
  - lib/awspec/helper/finder/alb.rb
341
344
  - lib/awspec/helper/finder/ami.rb
342
345
  - lib/awspec/helper/finder/autoscaling.rb
@@ -393,6 +396,7 @@ files:
393
396
  - lib/awspec/setup.rb
394
397
  - lib/awspec/shared_context.rb
395
398
  - lib/awspec/stub.rb
399
+ - lib/awspec/stub/acm.rb
396
400
  - lib/awspec/stub/alb.rb
397
401
  - lib/awspec/stub/ami.rb
398
402
  - lib/awspec/stub/autoscaling_group.rb
@@ -442,6 +446,7 @@ files:
442
446
  - lib/awspec/stub/vpn_gateway.rb
443
447
  - lib/awspec/stub/waf_web_acl.rb
444
448
  - lib/awspec/toolbox.rb
449
+ - lib/awspec/type/acm.rb
445
450
  - lib/awspec/type/alb.rb
446
451
  - lib/awspec/type/ami.rb
447
452
  - lib/awspec/type/autoscaling_group.rb