awspec 1.10.0 → 1.11.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
  SHA256:
3
- metadata.gz: 6655351533f5b1e75da73be4f8d6afb5d33f217af8395c0167404526ed6b0d69
4
- data.tar.gz: '01973536aea2d38dca2984f561c36cc266aa14f4e2b7a8892173a3ebf94188eb'
3
+ metadata.gz: 4796b48000c3ad199df777496b919e7a4552f213c667f9d2db1c3d68c8e3613a
4
+ data.tar.gz: f7f643fbd5e24bc8fea279d2e15da65fb0546b646cdaa41a04b5ef6448c9e6d7
5
5
  SHA512:
6
- metadata.gz: c282cea7043cfc622a81cac9eeb0cd8830bc70fc6586ddc2c761ee21bac746b94daeec4470e1779142a4b8bc6aba2e595a94b4bf891b3554e8f0cdde0b22e94e
7
- data.tar.gz: df86ffd6f2a31554d9eae1f017be1e741178f07126c3e789e8ff500197f3c37a097198b8f20e5556ba2cd91c2acff51238a282ef70df47d70ff55091721aa91a
6
+ metadata.gz: 3e7678a30b406bc0b948fd80015b5d5a0706ea44749039fde211d723dbe3a3e634d2ea019fafaf60a6e3bd06caf55b6974818d01b46463232b257df0b032b5fd
7
+ data.tar.gz: 1324b06b2abc219beebcaa8b79caecabc014d704ecc8708415f2d2c9ce67695f0c16bc46b0deb785bc995ea64438226dcf8b295c96b8ca68a8fe964b8fa65256
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # awspec [![Gem](https://img.shields.io/gem/v/awspec.svg)](https://rubygems.org/gems/awspec) [![Travis](https://img.shields.io/travis/k1LoW/awspec.svg)](https://travis-ci.org/k1LoW/awspec) [![Scrutinizer](https://img.shields.io/scrutinizer/g/k1LoW/awspec.svg)](https://scrutinizer-ci.com/g/k1LoW/awspec/)
1
+ # awspec [![Gem](https://img.shields.io/gem/v/awspec.svg)](https://rubygems.org/gems/awspec) [![Travis](https://img.shields.io/travis/k1LoW/awspec.svg)](https://travis-ci.org/k1LoW/awspec)
2
2
 
3
3
  ![Logo](./awspec-logo.png)
4
4
 
@@ -0,0 +1,14 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe eks('my-eks') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+ ### be_active, be_creating
9
+
10
+ ```ruby
11
+ describe eks('my-eks') do
12
+ it { should be_active }
13
+ end
14
+ ```
@@ -29,6 +29,7 @@
29
29
  | [ecs_task_definition](#ecs_task_definition)
30
30
  | [efs](#efs)
31
31
  | [eip](#eip)
32
+ | [eks](#eks)
32
33
  | [elasticache](#elasticache)
33
34
  | [elasticache_cache_parameter_group](#elasticache_cache_parameter_group)
34
35
  | [elasticsearch](#elasticsearch)
@@ -1168,6 +1169,27 @@ end
1168
1169
  ```
1169
1170
 
1170
1171
 
1172
+ ## <a name="eks">eks</a>
1173
+
1174
+ Eks resource type.
1175
+
1176
+ ### exist
1177
+
1178
+ ```ruby
1179
+ describe eks('my-eks') do
1180
+ it { should exist }
1181
+ end
1182
+ ```
1183
+
1184
+ ### be_active, be_creating
1185
+
1186
+ ```ruby
1187
+ describe eks('my-eks') do
1188
+ it { should be_active }
1189
+ end
1190
+ ```
1191
+
1192
+ ### its(:name), its(:arn), its(:created_at), its(:version), its(:endpoint), its(:role_arn), its(:status), its(:client_request_token), its(:platform_version)
1171
1193
  ## <a name="elasticache">elasticache</a>
1172
1194
 
1173
1195
  Elasticache resource type.
@@ -0,0 +1,20 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class Eks < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'Eks'
8
+ @type = Awspec::Type::Eks.new('my-eks')
9
+ @ret = @type.resource_via_client
10
+ @matchers = [
11
+ Awspec::Type::Eks::STATES.map { |state| 'be_' + state.downcase }.join(', ')
12
+ ]
13
+ @ignore_matchers = Awspec::Type::Eks::STATES.map { |state| 'be_' + state.downcase }
14
+
15
+ @describes = []
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -39,6 +39,7 @@ require 'awspec/helper/finder/codebuild'
39
39
  require 'awspec/helper/finder/apigateway'
40
40
  require 'awspec/helper/finder/kinesis'
41
41
  require 'awspec/helper/finder/batch'
42
+ require 'awspec/helper/finder/eks'
42
43
 
43
44
  require 'awspec/helper/finder/account_attributes'
44
45
 
@@ -87,6 +88,7 @@ module Awspec::Helper
87
88
  include Awspec::Helper::Finder::Apigateway
88
89
  include Awspec::Helper::Finder::Kinesis
89
90
  include Awspec::Helper::Finder::Batch
91
+ include Awspec::Helper::Finder::Eks
90
92
 
91
93
  CLIENTS = {
92
94
  ec2_client: Aws::EC2::Client,
@@ -123,7 +125,8 @@ module Awspec::Helper
123
125
  codebuild_client: Aws::CodeBuild::Client,
124
126
  apigateway_client: Aws::APIGateway::Client,
125
127
  kinesis_client: Aws::Kinesis::Client,
126
- batch_client: Aws::Batch::Client
128
+ batch_client: Aws::Batch::Client,
129
+ eks_client: Aws::EKS::Client
127
130
  }
128
131
 
129
132
  CLIENT_OPTIONS = {
@@ -0,0 +1,10 @@
1
+ module Awspec::Helper
2
+ module Finder
3
+ module Eks
4
+ def find_eks_cluster(name)
5
+ res = eks_client.describe_cluster({ name: name })
6
+ res.cluster
7
+ end
8
+ end
9
+ end
10
+ end
@@ -12,7 +12,7 @@ module Awspec
12
12
  batch_compute_environment batch_job_definition batch_job_queue cloudtrail
13
13
  cloudwatch_alarm cloudwatch_event directconnect_virtual_interface
14
14
  ebs ec2 ecr_repository ecs_cluster ecs_container_instance ecs_service ecs_task_definition
15
- efs elasticache elasticache_cache_parameter_group elasticsearch elb firehose iam_group
15
+ efs eks elasticache elasticache_cache_parameter_group elasticsearch elb firehose iam_group
16
16
  iam_policy iam_role iam_user kinesis kms lambda launch_configuration nat_gateway
17
17
  network_acl network_interface nlb nlb_listener nlb_target_group
18
18
  rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
@@ -0,0 +1,28 @@
1
+ Aws.config[:eks] = {
2
+ stub_responses: {
3
+ describe_cluster: {
4
+ cluster: {
5
+ version: '1.10',
6
+ name: 'devel',
7
+ arn: 'arn:aws:eks:us-west-2:012345678910:cluster/devel',
8
+ certificate_authority: {
9
+ data: 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2='
10
+ },
11
+ created_at: Time.parse('2018-10-28 00:23:32 -0400'),
12
+ endpoint: 'https://A0DCCD80A04F01705DD065655C30CC3D.yl4.us-west-2.eks.amazonaws.com',
13
+ resources_vpc_config: {
14
+ security_group_ids: [
15
+ 'sg-6979fe18'
16
+ ],
17
+ subnet_ids: [
18
+ 'subnet-6782e71e',
19
+ 'subnet-e7e761ac'
20
+ ],
21
+ vpc_id: 'vpc-950809ec'
22
+ },
23
+ role_arn: 'arn:aws:iam::012345678910:role/eks-service-role',
24
+ status: 'ACTIVE'
25
+ }
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,24 @@
1
+ module Awspec::Type
2
+ class Eks < ResourceBase
3
+ def initialize(name)
4
+ super
5
+ @name = name
6
+ end
7
+
8
+ def resource_via_client
9
+ @resource_via_client ||= find_eks_cluster(@name)
10
+ end
11
+
12
+ def id
13
+ @id ||= resource_via_client.name if resource_via_client
14
+ end
15
+
16
+ STATES = %w(ACTIVE CREATING)
17
+
18
+ STATES.each do |state|
19
+ define_method state.downcase + '?' do
20
+ resource_via_client.status == state
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '1.10.0'
2
+ VERSION = '1.11.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
@@ -242,6 +242,7 @@ files:
242
242
  - doc/_resource_types/ecs_task_definition.md
243
243
  - doc/_resource_types/efs.md
244
244
  - doc/_resource_types/eip.md
245
+ - doc/_resource_types/eks.md
245
246
  - doc/_resource_types/elasticache.md
246
247
  - doc/_resource_types/elasticache_cache_parameter_group.md
247
248
  - doc/_resource_types/elasticsearch.md
@@ -329,6 +330,7 @@ files:
329
330
  - lib/awspec/generator/doc/type/ecs_task_definition.rb
330
331
  - lib/awspec/generator/doc/type/efs.rb
331
332
  - lib/awspec/generator/doc/type/eip.rb
333
+ - lib/awspec/generator/doc/type/eks.rb
332
334
  - lib/awspec/generator/doc/type/elasticache.rb
333
335
  - lib/awspec/generator/doc/type/elasticache_cache_parameter_group.rb
334
336
  - lib/awspec/generator/doc/type/elasticsearch.rb
@@ -427,6 +429,7 @@ files:
427
429
  - lib/awspec/helper/finder/ecr.rb
428
430
  - lib/awspec/helper/finder/ecs.rb
429
431
  - lib/awspec/helper/finder/efs.rb
432
+ - lib/awspec/helper/finder/eks.rb
430
433
  - lib/awspec/helper/finder/elasticache.rb
431
434
  - lib/awspec/helper/finder/elasticsearch.rb
432
435
  - lib/awspec/helper/finder/elastictranscoder.rb
@@ -519,6 +522,7 @@ files:
519
522
  - lib/awspec/stub/ecs_task_definition.rb
520
523
  - lib/awspec/stub/efs.rb
521
524
  - lib/awspec/stub/eip.rb
525
+ - lib/awspec/stub/eks.rb
522
526
  - lib/awspec/stub/elasticache.rb
523
527
  - lib/awspec/stub/elasticache_cache_parameter_group.rb
524
528
  - lib/awspec/stub/elasticsearch.rb
@@ -590,6 +594,7 @@ files:
590
594
  - lib/awspec/type/ecs_task_definition.rb
591
595
  - lib/awspec/type/efs.rb
592
596
  - lib/awspec/type/eip.rb
597
+ - lib/awspec/type/eks.rb
593
598
  - lib/awspec/type/elasticache.rb
594
599
  - lib/awspec/type/elasticache_cache_parameter_group.rb
595
600
  - lib/awspec/type/elasticsearch.rb