awspec 1.19.2 → 1.20.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: 0cb0f518cbb9a6fd1719a6ab94547039f8ce88140d1a3536f47813f2c1de866a
4
- data.tar.gz: 7ac384fb88ba40da139ba7ff562b17b93c2000a89dada4011ad9a3eeda64976a
3
+ metadata.gz: 50e4f2db388c2466cf1cc06da613acd875dd5e6cc586087f07372f0a1e7145b1
4
+ data.tar.gz: 336ec6c6a6700edfbb1c66c0b164343a519eaf73d4fb2a6f8ff6a095e19b8640
5
5
  SHA512:
6
- metadata.gz: 027a2d063404ce032e2257d01e520a142152e81c33118d69a8a1a2f8defc9667b50f45362bc9051ef6e08594f47d4d9cc2fcafb64b508ce9e023bbd01a61701f
7
- data.tar.gz: ad59add2cf039e0e2371b96899106f970c1d0a64ef3a0aca81f54af7f9fa9c5253563cad3772e1579f88837fe227ce34fe5de1cc23c3eba48f4eec8f56d080f8
6
+ metadata.gz: c357e4f6650a48b03bd1eb3a454526a93dd2a885852de2fb5ee589a2eb468c87a2351512f802718f627587d85948b659b5894adaa12056d97ed1b8ca6419b99c
7
+ data.tar.gz: c091e6ece098aa98600e43e4ae4cd6413516d4a59f20a17d2d5b6d596695037b202b6246dfc5321504c318e3623b5bd3babc3d1dd0c8ef4d9db26f68a528410b
@@ -0,0 +1,15 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe msk('my-msk') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### should be_active, be_creating, be_updating, be_deleting, be_failed
10
+
11
+ ```ruby
12
+ describe msk('my-msk') do
13
+ it { should be_active }
14
+ end
15
+ ```
@@ -0,0 +1,24 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe tgw('tgw-1234567890abcdefg') do
5
+ it { should exist }
6
+ it { should have_tag('Name').value('my-tgw') }
7
+ it { should have_attachment('tgw-attach-1234567890abcdefg') }
8
+ its('options.amazon_side_asn') { should eq 64_516 }
9
+ its('options.auto_accept_shared_attachments') { should eq 'enable' }
10
+ its('options.default_route_table_association') { should eq 'enable' }
11
+ its('options.default_route_table_propagation') { should eq 'enable' }
12
+ its('options.dns_support') { should eq 'enable' }
13
+ its('options.vpn_ecmp_support') { should eq 'enable' }
14
+ its('options.association_default_route_table_id') { should eq 'tgw-rtb-0123456789abcdefg' }
15
+ its('options.propagation_default_route_table_id') { should eq 'tgw-rtb-0123456789abcdefg' }
16
+ end
17
+ ```
18
+
19
+ ```ruby
20
+ describe tgw('my-tgw') do
21
+ it { should exist }
22
+ its(:transit_gateway_id) { should eq 'tgw-1234567890abcdefg' }
23
+ end
24
+ ```
@@ -50,6 +50,7 @@
50
50
  | [launch_configuration](#launch_configuration)
51
51
  | [launch_template](#launch_template)
52
52
  | [mq](#mq)
53
+ | [msk](#msk)
53
54
  | [nat_gateway](#nat_gateway)
54
55
  | [network_acl](#network_acl)
55
56
  | [network_interface](#network_interface)
@@ -71,6 +72,7 @@
71
72
  | [sqs](#sqs)
72
73
  | [ssm_parameter](#ssm_parameter)
73
74
  | [subnet](#subnet)
75
+ | [transit_gateway](#transit_gateway)
74
76
  | [vpc](#vpc)
75
77
  | [vpn_connection](#vpn_connection)
76
78
  | [vpn_gateway](#vpn_gateway)
@@ -2182,7 +2184,7 @@ end
2182
2184
 
2183
2185
  This matcher does not support Amazon S3 event sources ([see SDK doc](http://docs.aws.amazon.com/sdkforruby/api/Aws/Lambda/Client.html#list_event_source_mappings-instance_method)).
2184
2186
 
2185
- ### its(:function_name), its(:function_arn), its(:runtime), its(:role), its(:handler), its(:code_size), its(:description), its(:timeout), its(:memory_size), its(:last_modified), its(:code_sha_256), its(:version), its(:vpc_config), its(:dead_letter_config), its(:kms_key_arn), its(:master_arn), its(:revision_id), its(:layers), its(:state), its(:state_reason), its(:state_reason_code), its(:last_update_status), its(:last_update_status_reason), its(:last_update_status_reason_code)
2187
+ ### its(:function_name), its(:function_arn), its(:runtime), its(:role), its(:handler), its(:code_size), its(:description), its(:timeout), its(:memory_size), its(:last_modified), its(:code_sha_256), its(:version), its(:vpc_config), its(:dead_letter_config), its(:kms_key_arn), its(:master_arn), its(:revision_id), its(:layers), its(:state), its(:state_reason), its(:state_reason_code), its(:last_update_status), its(:last_update_status_reason), its(:last_update_status_reason_code), its(:file_system_configs)
2186
2188
  ## <a name="launch_configuration">launch_configuration</a>
2187
2189
 
2188
2190
  LaunchConfiguration resource type.
@@ -2305,6 +2307,30 @@ end
2305
2307
  ```
2306
2308
 
2307
2309
  ### its(:vpc_id), its(:auto_minor_version_upgrade), its(:broker_arn), its(:broker_id), its(:broker_name), its(:broker_state), its(:created), its(:deployment_mode), its(:encryption_options), its(:engine_type), its(:engine_version), its(:host_instance_type), its(:pending_engine_version), its(:pending_host_instance_type), its(:pending_security_groups), its(:publicly_accessible), its(:security_groups), its(:storage_type), its(:subnet_ids)
2310
+ ## <a name="msk">msk</a>
2311
+
2312
+ Msk resource type.
2313
+
2314
+ ### exist
2315
+
2316
+ ```ruby
2317
+ describe msk('my-msk') do
2318
+ it { should exist }
2319
+ end
2320
+ ```
2321
+
2322
+
2323
+ ### be_active
2324
+
2325
+ ### be_creating
2326
+
2327
+ ### be_deleting
2328
+
2329
+ ### be_failed
2330
+
2331
+ ### be_updating
2332
+
2333
+ ### its(:active_operation_arn), its(:client_authentication), its(:cluster_arn), its(:cluster_name), its(:creation_time), its(:current_version), its(:enhanced_monitoring), its(:number_of_broker_nodes), its(:state), its(:zookeeper_connect_string)
2308
2334
  ## <a name="nat_gateway">nat_gateway</a>
2309
2335
 
2310
2336
  NatGateway resource type.
@@ -3456,6 +3482,40 @@ describe subnet('my-subnet') do
3456
3482
  end
3457
3483
  ```
3458
3484
 
3485
+ ## <a name="transit_gateway">transit_gateway</a>
3486
+
3487
+ TransitGateway resource type.
3488
+
3489
+ ### exist
3490
+
3491
+ ```ruby
3492
+ describe tgw('tgw-1234567890abcdefg') do
3493
+ it { should exist }
3494
+ it { should have_tag('Name').value('my-tgw') }
3495
+ it { should have_attachment('tgw-attach-1234567890abcdefg') }
3496
+ its('options.amazon_side_asn') { should eq 64_516 }
3497
+ its('options.auto_accept_shared_attachments') { should eq 'enable' }
3498
+ its('options.default_route_table_association') { should eq 'enable' }
3499
+ its('options.default_route_table_propagation') { should eq 'enable' }
3500
+ its('options.dns_support') { should eq 'enable' }
3501
+ its('options.vpn_ecmp_support') { should eq 'enable' }
3502
+ its('options.association_default_route_table_id') { should eq 'tgw-rtb-0123456789abcdefg' }
3503
+ its('options.propagation_default_route_table_id') { should eq 'tgw-rtb-0123456789abcdefg' }
3504
+ end
3505
+ ```
3506
+
3507
+ ```ruby
3508
+ describe tgw('my-tgw') do
3509
+ it { should exist }
3510
+ its(:transit_gateway_id) { should eq 'tgw-1234567890abcdefg' }
3511
+ end
3512
+ ```
3513
+
3514
+ ### have_attachment
3515
+
3516
+ ### have_tag
3517
+
3518
+ ### its(:transit_gateway_id), its(:transit_gateway_arn), its(:state), its(:owner_id), its(:description), its(:creation_time)
3459
3519
  ## <a name="vpc">vpc</a>
3460
3520
 
3461
3521
  VPC resource type.
@@ -0,0 +1,17 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class Msk < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'Msk'
8
+ @type = Awspec::Type::Msk.new('my-msk')
9
+ @ret = @type.resource_via_client
10
+ @matchers = []
11
+ @ignore_matchers = []
12
+ @describes = []
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class TransitGateway < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'TransitGateway'
8
+ @type = Awspec::Type::TransitGateway.new('my-transit-gateway')
9
+ @ret = @type.resource_via_client
10
+ @matchers = []
11
+ @ignore_matchers = []
12
+ @describes = []
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -47,6 +47,7 @@ require 'awspec/helper/finder/redshift'
47
47
  require 'awspec/helper/finder/codedeploy'
48
48
  require 'awspec/helper/finder/mq'
49
49
  require 'awspec/helper/finder/secretsmanager'
50
+ require 'awspec/helper/finder/msk'
50
51
 
51
52
  require 'awspec/helper/finder/account_attributes'
52
53
 
@@ -103,6 +104,7 @@ module Awspec::Helper
103
104
  include Awspec::Helper::Finder::Codedeploy
104
105
  include Awspec::Helper::Finder::Mq
105
106
  include Awspec::Helper::Finder::Secretsmanager
107
+ include Awspec::Helper::Finder::Msk
106
108
 
107
109
  CLIENTS = {
108
110
  ec2_client: Aws::EC2::Client,
@@ -147,7 +149,8 @@ module Awspec::Helper
147
149
  redshift_client: Aws::Redshift::Client,
148
150
  codedeploy_client: Aws::CodeDeploy::Client,
149
151
  mq_client: Aws::MQ::Client,
150
- secretsmanager_client: Aws::SecretsManager::Client
152
+ secretsmanager_client: Aws::SecretsManager::Client,
153
+ msk_client: Aws::Kafka::Client
151
154
  }
152
155
 
153
156
  CLIENT_OPTIONS = {
@@ -43,7 +43,7 @@ module Awspec::Helper
43
43
  end
44
44
 
45
45
  # find_internet_gateway find_vpn_gateway find_customer_gateway
46
- gateway_types = %w(internet vpn customer)
46
+ gateway_types = %w(internet vpn customer transit)
47
47
  gateway_types.each do |type|
48
48
  define_method 'find_' + type + '_gateway' do |*args|
49
49
  gateway_id = args.first
@@ -198,6 +198,15 @@ module Awspec::Helper
198
198
  launch_template_name: id
199
199
  })
200
200
  end
201
+
202
+ def find_tgw_attachments_by_tgw_id(tgw_id)
203
+ res = ec2_client.describe_transit_gateway_attachments({
204
+ filters: [
205
+ { name: 'transit-gateway-id', values: [tgw_id] }
206
+ ]
207
+ })
208
+ res.transit_gateway_attachments
209
+ end
201
210
  end
202
211
  end
203
212
  end
@@ -0,0 +1,15 @@
1
+ module Awspec::Helper
2
+ module Finder
3
+ module Msk
4
+ def find_msk_cluster_by_name(cluster_name)
5
+ res = msk_client.list_clusters(
6
+ {
7
+ cluster_name_filter: cluster_name,
8
+ max_results: 1
9
+ }
10
+ )
11
+ res.cluster_info_list[0]
12
+ end
13
+ end
14
+ end
15
+ end
@@ -20,7 +20,7 @@ module Awspec
20
20
  elastictranscoder_pipeline waf_web_acl wafregional_web_acl customer_gateway vpn_gateway vpn_connection
21
21
  internet_gateway acm cloudwatch_logs dynamodb_table eip sqs ssm_parameter cloudformation_stack
22
22
  codebuild sns_topic redshift redshift_cluster_parameter_group codedeploy codedeploy_deployment_group
23
- secretsmanager
23
+ secretsmanager msk transit_gateway
24
24
  )
25
25
 
26
26
  ACCOUNT_ATTRIBUTES = %w(
@@ -0,0 +1,84 @@
1
+ Aws.config[:kafka] = {
2
+ stub_responses: {
3
+ list_clusters: {
4
+ cluster_info_list: [
5
+ {
6
+ active_operation_arn: nil,
7
+ broker_node_group_info: {
8
+ broker_az_distribution: 'DEFAULT',
9
+ client_subnets: [
10
+ 'subnet-12345678909876543',
11
+ 'subnet-90876543212345678'
12
+ ],
13
+ instance_type: 'kafka.t3.small',
14
+ security_groups: [
15
+ 'sg-65432123456789098'
16
+ ],
17
+ storage_info: {
18
+ ebs_storage_info: {
19
+ volume_size: 1
20
+ }
21
+ }
22
+ },
23
+ client_authentication: nil,
24
+ cluster_arn: 'arn:aws:kafka:us-east-1:123456789098:cluster/did-inventory/\
25
+ a12345b6-123c-1de2-1234-f1g23h45i678-9',
26
+ cluster_name: 'my-msk',
27
+ creation_time: Time.new(2019, 1, 2, 10, 10, 00, '+00:00'),
28
+ current_broker_software_info: {
29
+ configuration_arn: nil,
30
+ configuration_revision: nil,
31
+ kafka_version: '2.2.1'
32
+ },
33
+ logging_info: {
34
+ broker_logs: {
35
+ cloud_watch_logs: {
36
+ enabled: false,
37
+ log_group: nil
38
+ },
39
+ firehose: {
40
+ delivery_stream: nil,
41
+ enabled: false
42
+ },
43
+ s3: {
44
+ bucket: nil,
45
+ enabled: false,
46
+ prefix: nil
47
+ }
48
+ }
49
+ },
50
+ current_version: 'A1BCDEFGHI23JK',
51
+ encryption_info: {
52
+ encryption_at_rest: {
53
+ data_volume_kms_key_id: 'arn:aws:kms:us-east-1:123456789098:key/ab1c2345-6789-01d2-3ee4-f56gh7i890jk'
54
+ },
55
+ encryption_in_transit: {
56
+ client_broker: 'TLS_PLAINTEXT',
57
+ in_cluster: true
58
+ }
59
+ },
60
+ enhanced_monitoring: 'DEFAULT',
61
+ number_of_broker_nodes: 2,
62
+ open_monitoring: {
63
+ prometheus: {
64
+ jmx_exporter: {
65
+ enabled_in_broker: false
66
+ },
67
+ node_exporter: {
68
+ enabled_in_broker: false
69
+ }
70
+ }
71
+ },
72
+ state: 'ACTIVE',
73
+ tags: {
74
+ 'Name' => 'my-msk'
75
+ },
76
+ zookeeper_connect_string: 'z-3.my-msk.1a23bc.d4.kafka.us-east-1.amazonaws.com:\
77
+ 1234,z-2.my-msk.1a23bc.d4.kafka.us-east-1.amazonaws.com:1234,z-1.my-msk.\
78
+ 1a23bc.d4.kafka.us-east-1.amazonaws.com:1234'
79
+ }
80
+ ],
81
+ next_token: nil
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,52 @@
1
+ Aws.config[:ec2] = {
2
+ stub_responses: {
3
+ describe_transit_gateways: {
4
+ transit_gateways: [
5
+ {
6
+ transit_gateway_id: 'tgw-1234567890abcdefg',
7
+ transit_gateway_arn: 'arn:aws:ec2:us-east-2:123456789012:transit-gateway/tgw-1234567890abcdefg',
8
+ owner_id: '123456789012',
9
+ options: {
10
+ amazon_side_asn: 64_516,
11
+ auto_accept_shared_attachments: 'enable',
12
+ default_route_table_association: 'enable',
13
+ default_route_table_propagation: 'enable',
14
+ dns_support: 'enable',
15
+ vpn_ecmp_support: 'enable',
16
+ association_default_route_table_id: 'tgw-rtb-0123456789abcdefg',
17
+ propagation_default_route_table_id: 'tgw-rtb-0123456789abcdefg'
18
+ },
19
+ tags: [
20
+ {
21
+ key: 'Name',
22
+ value: 'my-transit-gateway'
23
+ }
24
+ ]
25
+ }
26
+ ]
27
+ },
28
+ describe_transit_gateway_attachments: {
29
+ transit_gateway_attachments: [
30
+ {
31
+ transit_gateway_attachment_id: 'tgw-attach-1234567890abcdefg',
32
+ transit_gateway_id: 'tgw-1234567890abcdefg',
33
+ transit_gateway_owner_id: '123456789012',
34
+ resource_owner_id: '123456789012',
35
+ resource_type: 'vpc',
36
+ resource_id: 'vpc-12345678',
37
+ state: 'available',
38
+ association: {
39
+ transit_gateway_route_table_id: 'tgw-rtb-0123456789abcdefg',
40
+ state: 'associated'
41
+ },
42
+ tags: [
43
+ {
44
+ key: 'Name',
45
+ value: 'my-transit-gateway-attachment'
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,27 @@
1
+ module Awspec::Type
2
+ class Msk < ResourceBase
3
+ def initialize(name)
4
+ super
5
+ @desplay_name = name
6
+ end
7
+
8
+ def resource_via_client
9
+ @resource_via_client ||= find_msk_cluster_by_name(@display_name)
10
+ end
11
+
12
+ def id
13
+ @id ||= resource_via_client.cluster_arn if resource_via_client
14
+ end
15
+
16
+ STATES = %w(
17
+ active creating updating
18
+ deleting failed
19
+ )
20
+
21
+ STATES.each do |state|
22
+ define_method state + '?' do
23
+ resource_via_client.state == state.upcase
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,24 @@
1
+ module Awspec::Type
2
+ class TransitGateway < ResourceBase
3
+ aws_resource Aws::EC2::Types::TransitGateway
4
+ tags_allowed
5
+
6
+ def resource_via_client
7
+ @resource_via_client ||= find_transit_gateway(@display_name)
8
+ end
9
+
10
+ def id
11
+ @id ||= resource_via_client.transit_gateway_id if resource_via_client
12
+ end
13
+
14
+ def options
15
+ resource_via_client.options
16
+ end
17
+
18
+ def has_attachment?(att_id)
19
+ atts = find_tgw_attachments_by_tgw_id(@id)
20
+ ret = atts.find_all { |att| att.transit_gateway_attachment_id == att_id }
21
+ ret.any?
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '1.19.2'
2
+ VERSION = '1.20.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: 1.19.2
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2020-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -283,6 +283,7 @@ files:
283
283
  - doc/_resource_types/launch_configuration.md
284
284
  - doc/_resource_types/launch_template.md
285
285
  - doc/_resource_types/mq.md
286
+ - doc/_resource_types/msk.md
286
287
  - doc/_resource_types/nat_gateway.md
287
288
  - doc/_resource_types/network_acl.md
288
289
  - doc/_resource_types/network_interface.md
@@ -306,6 +307,7 @@ files:
306
307
  - doc/_resource_types/sqs.md
307
308
  - doc/_resource_types/ssm_parameter.md
308
309
  - doc/_resource_types/subnet.md
310
+ - doc/_resource_types/transit_gateway.md
309
311
  - doc/_resource_types/vpc.md
310
312
  - doc/_resource_types/vpn_connection.md
311
313
  - doc/_resource_types/vpn_gateway.md
@@ -382,6 +384,7 @@ files:
382
384
  - lib/awspec/generator/doc/type/launch_configuration.rb
383
385
  - lib/awspec/generator/doc/type/launch_template.rb
384
386
  - lib/awspec/generator/doc/type/mq.rb
387
+ - lib/awspec/generator/doc/type/msk.rb
385
388
  - lib/awspec/generator/doc/type/nat_gateway.rb
386
389
  - lib/awspec/generator/doc/type/network_acl.rb
387
390
  - lib/awspec/generator/doc/type/network_interface.rb
@@ -405,6 +408,7 @@ files:
405
408
  - lib/awspec/generator/doc/type/sqs.rb
406
409
  - lib/awspec/generator/doc/type/ssm_parameter.rb
407
410
  - lib/awspec/generator/doc/type/subnet.rb
411
+ - lib/awspec/generator/doc/type/transit_gateway.rb
408
412
  - lib/awspec/generator/doc/type/vpc.rb
409
413
  - lib/awspec/generator/doc/type/vpn_connection.rb
410
414
  - lib/awspec/generator/doc/type/vpn_gateway.rb
@@ -487,6 +491,7 @@ files:
487
491
  - lib/awspec/helper/finder/kms.rb
488
492
  - lib/awspec/helper/finder/lambda.rb
489
493
  - lib/awspec/helper/finder/mq.rb
494
+ - lib/awspec/helper/finder/msk.rb
490
495
  - lib/awspec/helper/finder/nlb.rb
491
496
  - lib/awspec/helper/finder/rds.rb
492
497
  - lib/awspec/helper/finder/redshift.rb
@@ -602,6 +607,7 @@ files:
602
607
  - lib/awspec/stub/launch_configuration.rb
603
608
  - lib/awspec/stub/launch_template.rb
604
609
  - lib/awspec/stub/mq.rb
610
+ - lib/awspec/stub/msk.rb
605
611
  - lib/awspec/stub/nat_gateway.rb
606
612
  - lib/awspec/stub/network_acl.rb
607
613
  - lib/awspec/stub/network_interface.rb
@@ -623,6 +629,7 @@ files:
623
629
  - lib/awspec/stub/sqs.rb
624
630
  - lib/awspec/stub/ssm_parameter.rb
625
631
  - lib/awspec/stub/subnet.rb
632
+ - lib/awspec/stub/transit_gateway.rb
626
633
  - lib/awspec/stub/vpc.rb
627
634
  - lib/awspec/stub/vpn_connection.rb
628
635
  - lib/awspec/stub/vpn_gateway.rb
@@ -685,6 +692,7 @@ files:
685
692
  - lib/awspec/type/launch_configuration.rb
686
693
  - lib/awspec/type/launch_template.rb
687
694
  - lib/awspec/type/mq.rb
695
+ - lib/awspec/type/msk.rb
688
696
  - lib/awspec/type/nat_gateway.rb
689
697
  - lib/awspec/type/network_acl.rb
690
698
  - lib/awspec/type/network_interface.rb
@@ -709,6 +717,7 @@ files:
709
717
  - lib/awspec/type/sqs.rb
710
718
  - lib/awspec/type/ssm_parameter.rb
711
719
  - lib/awspec/type/subnet.rb
720
+ - lib/awspec/type/transit_gateway.rb
712
721
  - lib/awspec/type/vpc.rb
713
722
  - lib/awspec/type/vpn_connection.rb
714
723
  - lib/awspec/type/vpn_gateway.rb