awspec 1.19.2 → 1.22.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/doc/_resource_types/cognito_identity_pool.md +7 -0
  3. data/doc/_resource_types/cognito_user_pool.md +7 -0
  4. data/doc/_resource_types/msk.md +15 -0
  5. data/doc/_resource_types/transit_gateway.md +24 -0
  6. data/doc/_resource_types/vpc_endpoints.md +70 -0
  7. data/doc/resource_types.md +186 -19
  8. data/lib/awspec/generator/doc/type/cognito_identity_pool.rb +17 -0
  9. data/lib/awspec/generator/doc/type/cognito_user_pool.rb +17 -0
  10. data/lib/awspec/generator/doc/type/msk.rb +17 -0
  11. data/lib/awspec/generator/doc/type/transit_gateway.rb +17 -0
  12. data/lib/awspec/generator/doc/type/vpc_endpoints.rb +17 -0
  13. data/lib/awspec/helper/finder.rb +14 -2
  14. data/lib/awspec/helper/finder/cognito_identity_pool.rb +15 -0
  15. data/lib/awspec/helper/finder/cognito_user_pool.rb +15 -0
  16. data/lib/awspec/helper/finder/ec2.rb +10 -1
  17. data/lib/awspec/helper/finder/ecr.rb +4 -0
  18. data/lib/awspec/helper/finder/msk.rb +15 -0
  19. data/lib/awspec/helper/finder/vpc_endpoints.rb +15 -0
  20. data/lib/awspec/helper/type.rb +1 -1
  21. data/lib/awspec/stub/cognito_identity_pool.rb +16 -0
  22. data/lib/awspec/stub/cognito_user_pool.rb +47 -0
  23. data/lib/awspec/stub/msk.rb +84 -0
  24. data/lib/awspec/stub/transit_gateway.rb +52 -0
  25. data/lib/awspec/stub/vpc_endpoints.rb +64 -0
  26. data/lib/awspec/type/cognito_identity_pool.rb +11 -0
  27. data/lib/awspec/type/cognito_user_pool.rb +11 -0
  28. data/lib/awspec/type/ecr_repository.rb +4 -0
  29. data/lib/awspec/type/msk.rb +27 -0
  30. data/lib/awspec/type/transit_gateway.rb +24 -0
  31. data/lib/awspec/type/vpc_endpoints.rb +43 -0
  32. data/lib/awspec/version.rb +1 -1
  33. metadata +26 -2
@@ -0,0 +1,64 @@
1
+ Aws.config[:ec2] = {
2
+ stub_responses: {
3
+ describe_vpc_endpoints: {
4
+ vpc_endpoints: [
5
+ {
6
+ vpc_endpoint_id: 'vpce-abc123',
7
+ vpc_endpoint_type: 'Gateway',
8
+ vpc_id: 'vpc-12345678',
9
+ service_name: 'com.amazonaws.us-east-1.s3',
10
+ state: 'available',
11
+ policy_document: '{"Version": "2008-10-17", "Statement": [{' \
12
+ '"Effect": "Allow", "Principal": "*", "Action": "*",' \
13
+ '"Resource": "*"}]}',
14
+ route_table_ids: ['rtb-0123456789abcdefg'],
15
+ subnet_ids: [],
16
+ groups: [],
17
+ private_dns_enabled: false,
18
+ requester_managed: false,
19
+ network_interface_ids: [],
20
+ dns_entries: [],
21
+ creation_timestamp: Time.new(2020, 8, 13, 9, 00, 00, '+00:00'),
22
+ tags: [
23
+ {
24
+ key: 'Name',
25
+ value: 'my_vpc_endpoint'
26
+ }
27
+ ],
28
+ owner_id: '112233445566'
29
+ },
30
+ {
31
+ vpc_endpoint_id: 'vpce-abc124',
32
+ vpc_endpoint_type: 'Interface',
33
+ vpc_id: 'vpc-12345678',
34
+ service_name: 'com.amazonaws.eu-west-1.codebuild',
35
+ state: 'available',
36
+ policy_document: '{"Version": "2008-10-17", "Statement": [{' \
37
+ '"Effect": "Allow", "Principal": "*", "Action": "*",' \
38
+ '"Resource": "*"}]}',
39
+ route_table_ids: [],
40
+ subnet_ids: ['subnet-abc123'],
41
+ groups: [{ group_id: 'sg-abc123', group_name: 'default' }],
42
+ private_dns_enabled: true,
43
+ requester_managed: false,
44
+ network_interface_ids: ['eni-06f28a949cb88b84c'],
45
+ dns_entries: [
46
+ {
47
+ dns_name: 'vpce-05907f23265b25f20-wwafshom.codebuild.eu-west-1.vpce.amazonaws.com',
48
+ hosted_zone_id: 'Z38GZ743OKFT7T'
49
+ }
50
+ ],
51
+ creation_timestamp: Time.new(2020, 8, 13, 9, 00, 00, '+00:00'),
52
+ tags: [
53
+ {
54
+ key: 'Name',
55
+ value: 'my_vpc_endpoint'
56
+ }
57
+ ],
58
+ owner_id: '112233445566'
59
+ }
60
+ ],
61
+ next_token: nil
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,11 @@
1
+ module Awspec::Type
2
+ class CognitoIdentityPool < ResourceBase
3
+ def resource_via_client
4
+ @resource_via_client ||= find_identitypool_by_name(@display_name)
5
+ end
6
+
7
+ def id
8
+ @id ||= resource_via_client.identity_pool_id if resource_via_client
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Awspec::Type
2
+ class CognitoUserPool < ResourceBase
3
+ def resource_via_client
4
+ @resource_via_client ||= find_userpool_by_name(@display_name)
5
+ end
6
+
7
+ def id
8
+ @id ||= resource_via_client.id if resource_via_client
9
+ end
10
+ end
11
+ end
@@ -14,5 +14,9 @@ module Awspec::Type
14
14
  def id
15
15
  @id ||= resource_via_client.repository_name if resource_via_client
16
16
  end
17
+
18
+ def policy_text
19
+ @policy_text ||= get_policy_text(@display_name)
20
+ end
17
21
  end
18
22
  end
@@ -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
@@ -0,0 +1,43 @@
1
+ module Awspec::Type
2
+ class VpcEndpoints < ResourceBase
3
+ aws_resource Aws::EC2::Types::VpcEndpoint
4
+ tags_allowed
5
+
6
+ def resource_via_client
7
+ @resource_via_client ||= find_vpc_endpoint(@display_name)
8
+ end
9
+
10
+ def id
11
+ @id ||= resource_via_client.vpc_endpoint_id if resource_via_client
12
+ end
13
+
14
+ STATES = %w(
15
+ pendingacceptance pending available deleting
16
+ deleted rejected failed expired
17
+ )
18
+
19
+ STATES.each do |state|
20
+ define_method state + '?' do
21
+ resource_via_client.state == state
22
+ end
23
+ end
24
+
25
+ def has_route_table?(route_table_id)
26
+ rts = resource_via_client.route_table_ids
27
+
28
+ ret = rts.find do |rt|
29
+ rt == route_table_id
30
+ end
31
+ return true if ret
32
+ end
33
+
34
+ def has_subnet?(subnet_id)
35
+ subnets = resource_via_client.subnet_ids
36
+
37
+ ret = subnets.find do |subnet|
38
+ subnet == subnet_id
39
+ end
40
+ return true if ret
41
+ end
42
+ end
43
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '1.19.2'
2
+ VERSION = '1.22.1'
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.22.1
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-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -251,6 +251,8 @@ files:
251
251
  - doc/_resource_types/codebuild.md
252
252
  - doc/_resource_types/codedeploy.md
253
253
  - doc/_resource_types/codedeploy_deployment_group.md
254
+ - doc/_resource_types/cognito_identity_pool.md
255
+ - doc/_resource_types/cognito_user_pool.md
254
256
  - doc/_resource_types/customer_gateway.md
255
257
  - doc/_resource_types/directconnect_virtual_interface.md
256
258
  - doc/_resource_types/dynamodb_table.md
@@ -283,6 +285,7 @@ files:
283
285
  - doc/_resource_types/launch_configuration.md
284
286
  - doc/_resource_types/launch_template.md
285
287
  - doc/_resource_types/mq.md
288
+ - doc/_resource_types/msk.md
286
289
  - doc/_resource_types/nat_gateway.md
287
290
  - doc/_resource_types/network_acl.md
288
291
  - doc/_resource_types/network_interface.md
@@ -306,7 +309,9 @@ files:
306
309
  - doc/_resource_types/sqs.md
307
310
  - doc/_resource_types/ssm_parameter.md
308
311
  - doc/_resource_types/subnet.md
312
+ - doc/_resource_types/transit_gateway.md
309
313
  - doc/_resource_types/vpc.md
314
+ - doc/_resource_types/vpc_endpoints.md
310
315
  - doc/_resource_types/vpn_connection.md
311
316
  - doc/_resource_types/vpn_gateway.md
312
317
  - doc/_resource_types/waf_web_acl.md
@@ -349,6 +354,8 @@ files:
349
354
  - lib/awspec/generator/doc/type/codebuild.rb
350
355
  - lib/awspec/generator/doc/type/codedeploy.rb
351
356
  - lib/awspec/generator/doc/type/codedeploy_deployment_group.rb
357
+ - lib/awspec/generator/doc/type/cognito_identity_pool.rb
358
+ - lib/awspec/generator/doc/type/cognito_user_pool.rb
352
359
  - lib/awspec/generator/doc/type/customer_gateway.rb
353
360
  - lib/awspec/generator/doc/type/directconnect_virtual_interface.rb
354
361
  - lib/awspec/generator/doc/type/dynamodb_table.rb
@@ -382,6 +389,7 @@ files:
382
389
  - lib/awspec/generator/doc/type/launch_configuration.rb
383
390
  - lib/awspec/generator/doc/type/launch_template.rb
384
391
  - lib/awspec/generator/doc/type/mq.rb
392
+ - lib/awspec/generator/doc/type/msk.rb
385
393
  - lib/awspec/generator/doc/type/nat_gateway.rb
386
394
  - lib/awspec/generator/doc/type/network_acl.rb
387
395
  - lib/awspec/generator/doc/type/network_interface.rb
@@ -405,7 +413,9 @@ files:
405
413
  - lib/awspec/generator/doc/type/sqs.rb
406
414
  - lib/awspec/generator/doc/type/ssm_parameter.rb
407
415
  - lib/awspec/generator/doc/type/subnet.rb
416
+ - lib/awspec/generator/doc/type/transit_gateway.rb
408
417
  - lib/awspec/generator/doc/type/vpc.rb
418
+ - lib/awspec/generator/doc/type/vpc_endpoints.rb
409
419
  - lib/awspec/generator/doc/type/vpn_connection.rb
410
420
  - lib/awspec/generator/doc/type/vpn_gateway.rb
411
421
  - lib/awspec/generator/doc/type/waf_web_acl.rb
@@ -468,6 +478,8 @@ files:
468
478
  - lib/awspec/helper/finder/cloudwatch_logs.rb
469
479
  - lib/awspec/helper/finder/codebuild.rb
470
480
  - lib/awspec/helper/finder/codedeploy.rb
481
+ - lib/awspec/helper/finder/cognito_identity_pool.rb
482
+ - lib/awspec/helper/finder/cognito_user_pool.rb
471
483
  - lib/awspec/helper/finder/directconnect.rb
472
484
  - lib/awspec/helper/finder/dynamodb.rb
473
485
  - lib/awspec/helper/finder/ebs.rb
@@ -487,6 +499,7 @@ files:
487
499
  - lib/awspec/helper/finder/kms.rb
488
500
  - lib/awspec/helper/finder/lambda.rb
489
501
  - lib/awspec/helper/finder/mq.rb
502
+ - lib/awspec/helper/finder/msk.rb
490
503
  - lib/awspec/helper/finder/nlb.rb
491
504
  - lib/awspec/helper/finder/rds.rb
492
505
  - lib/awspec/helper/finder/redshift.rb
@@ -500,6 +513,7 @@ files:
500
513
  - lib/awspec/helper/finder/ssm_parameter.rb
501
514
  - lib/awspec/helper/finder/subnet.rb
502
515
  - lib/awspec/helper/finder/vpc.rb
516
+ - lib/awspec/helper/finder/vpc_endpoints.rb
503
517
  - lib/awspec/helper/finder/waf.rb
504
518
  - lib/awspec/helper/finder/wafregional.rb
505
519
  - lib/awspec/helper/type.rb
@@ -568,6 +582,8 @@ files:
568
582
  - lib/awspec/stub/codebuild.rb
569
583
  - lib/awspec/stub/codedeploy.rb
570
584
  - lib/awspec/stub/codedeploy_deployment_group.rb
585
+ - lib/awspec/stub/cognito_identity_pool.rb
586
+ - lib/awspec/stub/cognito_user_pool.rb
571
587
  - lib/awspec/stub/customer_gateway.rb
572
588
  - lib/awspec/stub/directconnect_virtual_interface.rb
573
589
  - lib/awspec/stub/duplicated_resource_type.rb
@@ -602,6 +618,7 @@ files:
602
618
  - lib/awspec/stub/launch_configuration.rb
603
619
  - lib/awspec/stub/launch_template.rb
604
620
  - lib/awspec/stub/mq.rb
621
+ - lib/awspec/stub/msk.rb
605
622
  - lib/awspec/stub/nat_gateway.rb
606
623
  - lib/awspec/stub/network_acl.rb
607
624
  - lib/awspec/stub/network_interface.rb
@@ -623,7 +640,9 @@ files:
623
640
  - lib/awspec/stub/sqs.rb
624
641
  - lib/awspec/stub/ssm_parameter.rb
625
642
  - lib/awspec/stub/subnet.rb
643
+ - lib/awspec/stub/transit_gateway.rb
626
644
  - lib/awspec/stub/vpc.rb
645
+ - lib/awspec/stub/vpc_endpoints.rb
627
646
  - lib/awspec/stub/vpn_connection.rb
628
647
  - lib/awspec/stub/vpn_gateway.rb
629
648
  - lib/awspec/stub/waf_web_acl.rb
@@ -652,6 +671,8 @@ files:
652
671
  - lib/awspec/type/codebuild.rb
653
672
  - lib/awspec/type/codedeploy.rb
654
673
  - lib/awspec/type/codedeploy_deployment_group.rb
674
+ - lib/awspec/type/cognito_identity_pool.rb
675
+ - lib/awspec/type/cognito_user_pool.rb
655
676
  - lib/awspec/type/customer_gateway.rb
656
677
  - lib/awspec/type/directconnect_virtual_interface.rb
657
678
  - lib/awspec/type/dynamodb_table.rb
@@ -685,6 +706,7 @@ files:
685
706
  - lib/awspec/type/launch_configuration.rb
686
707
  - lib/awspec/type/launch_template.rb
687
708
  - lib/awspec/type/mq.rb
709
+ - lib/awspec/type/msk.rb
688
710
  - lib/awspec/type/nat_gateway.rb
689
711
  - lib/awspec/type/network_acl.rb
690
712
  - lib/awspec/type/network_interface.rb
@@ -709,7 +731,9 @@ files:
709
731
  - lib/awspec/type/sqs.rb
710
732
  - lib/awspec/type/ssm_parameter.rb
711
733
  - lib/awspec/type/subnet.rb
734
+ - lib/awspec/type/transit_gateway.rb
712
735
  - lib/awspec/type/vpc.rb
736
+ - lib/awspec/type/vpc_endpoints.rb
713
737
  - lib/awspec/type/vpn_connection.rb
714
738
  - lib/awspec/type/vpn_gateway.rb
715
739
  - lib/awspec/type/waf_web_acl.rb