awspec 1.32.0 → 1.33.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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/doc/_resource_types/backup_plan.md +7 -0
  4. data/doc/_resource_types/backup_selection.md +7 -0
  5. data/doc/_resource_types/backup_vault.md +35 -0
  6. data/doc/_resource_types/rds_db_cluster.md +8 -0
  7. data/doc/_resource_types/rds_global_cluster.md +8 -0
  8. data/doc/_resource_types/transfer_server.md +4 -0
  9. data/doc/_resource_types/wafv2_ip_set.md +6 -2
  10. data/doc/_resource_types/wafv2_web_acl.md +25 -0
  11. data/doc/contributing.md +2 -2
  12. data/doc/resource_types.md +125 -29
  13. data/lib/awspec/generator/doc/type/backup_plan.rb +19 -0
  14. data/lib/awspec/generator/doc/type/backup_selection.rb +19 -0
  15. data/lib/awspec/generator/doc/type/backup_vault.rb +19 -0
  16. data/lib/awspec/generator/doc/type/wafv2_ip_set.rb +1 -1
  17. data/lib/awspec/generator/doc/type/wafv2_web_acl.rb +19 -0
  18. data/lib/awspec/generator/spec/wafv2_web_acl.rb +39 -0
  19. data/lib/awspec/generator.rb +1 -0
  20. data/lib/awspec/helper/finder/backup.rb +88 -0
  21. data/lib/awspec/helper/finder/transfer.rb +21 -1
  22. data/lib/awspec/helper/finder/wafv2.rb +20 -0
  23. data/lib/awspec/helper/finder.rb +4 -1
  24. data/lib/awspec/helper/type.rb +2 -1
  25. data/lib/awspec/matcher/belong_to_backup_plan.rb +12 -0
  26. data/lib/awspec/matcher/have_rule.rb +5 -0
  27. data/lib/awspec/matcher.rb +3 -0
  28. data/lib/awspec/stub/backup_plan.rb +33 -0
  29. data/lib/awspec/stub/backup_selection.rb +33 -0
  30. data/lib/awspec/stub/backup_vault.rb +53 -0
  31. data/lib/awspec/stub/rds_db_cluster.rb +6 -1
  32. data/lib/awspec/stub/rds_global_cluster.rb +7 -1
  33. data/lib/awspec/stub/transfer_server.rb +25 -6
  34. data/lib/awspec/stub/wafv2_ip_set.rb +7 -5
  35. data/lib/awspec/stub/wafv2_web_acl.rb +151 -0
  36. data/lib/awspec/type/backup_plan.rb +13 -0
  37. data/lib/awspec/type/backup_selection.rb +13 -0
  38. data/lib/awspec/type/backup_vault.rb +13 -0
  39. data/lib/awspec/type/base.rb +5 -1
  40. data/lib/awspec/type/codepipeline.rb +1 -1
  41. data/lib/awspec/type/rds_db_cluster.rb +1 -0
  42. data/lib/awspec/type/rds_global_cluster.rb +1 -0
  43. data/lib/awspec/type/transfer_server.rb +4 -7
  44. data/lib/awspec/type/wafv2_web_acl.rb +33 -0
  45. data/lib/awspec/version.rb +1 -1
  46. metadata +21 -2
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Awspec::Type
4
+ class BackupSelection < ResourceBase
5
+ def resource_via_client
6
+ @resource_via_client ||= find_backup_selection(@display_name)
7
+ end
8
+
9
+ def id
10
+ @id ||= resource_via_client.selection_id if resource_via_client
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Awspec::Type
4
+ class BackupVault < ResourceBase
5
+ def resource_via_client
6
+ @resource_via_client ||= find_backup_vault(@display_name)
7
+ end
8
+
9
+ def id
10
+ @id ||= resource_via_client.backup_vault_arn if resource_via_client
11
+ end
12
+ end
13
+ end
@@ -33,7 +33,11 @@ module Awspec::Type
33
33
  begin
34
34
  tags = resource_via_client.tags
35
35
  rescue NoMethodError
36
- tags = resource_via_client.tag_set
36
+ begin
37
+ tags = resource_via_client.tag_set
38
+ rescue NoMethodError
39
+ tags = resource_via_client.tag_list
40
+ end
37
41
  end
38
42
  return false unless tags
39
43
 
@@ -7,7 +7,7 @@ module Awspec::Type
7
7
  end
8
8
 
9
9
  def id
10
- @id ||= resource_via_client if resource_via_client.name
10
+ @id ||= resource_via_client.name if resource_via_client
11
11
  end
12
12
  end
13
13
  end
@@ -3,6 +3,7 @@
3
3
  module Awspec::Type
4
4
  class RdsDBCluster < ResourceBase
5
5
  aws_resource Aws::RDS::Types::DBCluster
6
+ tags_allowed
6
7
 
7
8
  def resource_via_client
8
9
  @resource_via_client ||= find_db_cluster(@display_name)
@@ -3,6 +3,7 @@
3
3
  module Awspec::Type
4
4
  class RdsGlobalCluster < ResourceBase
5
5
  aws_resource Aws::RDS::Types::GlobalCluster
6
+ tags_allowed
6
7
 
7
8
  def resource_via_client
8
9
  @resource_via_client ||= find_global_cluster(@display_name)
@@ -2,17 +2,14 @@
2
2
 
3
3
  module Awspec::Type
4
4
  class TransferServer < ResourceBase
5
- attr_reader :id
6
-
7
5
  tags_allowed
8
6
 
9
- def initialize(id)
10
- super
11
- @id = id
7
+ def resource_via_client
8
+ @resource_via_client ||= find_transfer_server(@display_name)
12
9
  end
13
10
 
14
- def resource_via_client
15
- @resource_via_client ||= find_transfer_server(@id)
11
+ def id
12
+ @id ||= resource_via_client.server_id if resource_via_client
16
13
  end
17
14
 
18
15
  STATES = %w[
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Awspec::Type
4
+ class Wafv2WebAcl < ResourceBase
5
+ attr_accessor :scope
6
+
7
+ def resource_via_client
8
+ @resource_via_client ||= find_web_acl(scope, @display_name)
9
+ end
10
+
11
+ def id
12
+ @id ||= resource_via_client.id if resource_via_client
13
+ end
14
+
15
+ def scope
16
+ @scope || 'REGIONAL'
17
+ end
18
+
19
+ def default_action
20
+ resource_via_client.default_action.allow ? 'ALLOW' : 'BLOCK'
21
+ end
22
+
23
+ def has_rule?(name, priority = nil, action = nil, override_action = nil)
24
+ resource_via_client.rules.find do |rule|
25
+ next false if !priority.nil? && rule.priority != priority
26
+ next false if !action.nil? && !rule.action.reject { |v| v.nil? }.first.class.to_s.include?(action.capitalize)
27
+ next false if !override_action.nil? &&
28
+ !rule.override_action.reject { |v| v.nil? }.first.class.to_s.include?(override_action.capitalize)
29
+ next true if rule.name == name
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Awspec
4
- VERSION = '1.32.0'
4
+ VERSION = '1.33.0'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.32.0
4
+ version: 1.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-28 00:00:00.000000000 Z
10
+ date: 2025-08-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: addressable
@@ -281,6 +281,9 @@ files:
281
281
  - doc/_resource_types/ami.md
282
282
  - doc/_resource_types/apigateway.md
283
283
  - doc/_resource_types/autoscaling_group.md
284
+ - doc/_resource_types/backup_plan.md
285
+ - doc/_resource_types/backup_selection.md
286
+ - doc/_resource_types/backup_vault.md
284
287
  - doc/_resource_types/batch_compute_environment.md
285
288
  - doc/_resource_types/batch_job_definition.md
286
289
  - doc/_resource_types/batch_job_queue.md
@@ -367,6 +370,7 @@ files:
367
370
  - doc/_resource_types/waf_web_acl.md
368
371
  - doc/_resource_types/wafregional_web_acl.md
369
372
  - doc/_resource_types/wafv2_ip_set.md
373
+ - doc/_resource_types/wafv2_web_acl.md
370
374
  - doc/contributing.md
371
375
  - doc/resource_types.md
372
376
  - exe/awspec
@@ -392,6 +396,9 @@ files:
392
396
  - lib/awspec/generator/doc/type/ami.rb
393
397
  - lib/awspec/generator/doc/type/apigateway.rb
394
398
  - lib/awspec/generator/doc/type/autoscaling_group.rb
399
+ - lib/awspec/generator/doc/type/backup_plan.rb
400
+ - lib/awspec/generator/doc/type/backup_selection.rb
401
+ - lib/awspec/generator/doc/type/backup_vault.rb
395
402
  - lib/awspec/generator/doc/type/base.rb
396
403
  - lib/awspec/generator/doc/type/batch_compute_environment.rb
397
404
  - lib/awspec/generator/doc/type/batch_job_definition.rb
@@ -480,6 +487,7 @@ files:
480
487
  - lib/awspec/generator/doc/type/waf_web_acl.rb
481
488
  - lib/awspec/generator/doc/type/wafregional_web_acl.rb
482
489
  - lib/awspec/generator/doc/type/wafv2_ip_set.rb
490
+ - lib/awspec/generator/doc/type/wafv2_web_acl.rb
483
491
  - lib/awspec/generator/spec/acm.rb
484
492
  - lib/awspec/generator/spec/alb.rb
485
493
  - lib/awspec/generator/spec/alb_listener.rb
@@ -525,6 +533,7 @@ files:
525
533
  - lib/awspec/generator/spec/subnet.rb
526
534
  - lib/awspec/generator/spec/vpc.rb
527
535
  - lib/awspec/generator/spec/wafv2_ip_set.rb
536
+ - lib/awspec/generator/spec/wafv2_web_acl.rb
528
537
  - lib/awspec/generator/template.rb
529
538
  - lib/awspec/helper.rb
530
539
  - lib/awspec/helper/client_wrap.rb
@@ -536,6 +545,7 @@ files:
536
545
  - lib/awspec/helper/finder/ami.rb
537
546
  - lib/awspec/helper/finder/apigateway.rb
538
547
  - lib/awspec/helper/finder/autoscaling.rb
548
+ - lib/awspec/helper/finder/backup.rb
539
549
  - lib/awspec/helper/finder/batch.rb
540
550
  - lib/awspec/helper/finder/cloudformation.rb
541
551
  - lib/awspec/helper/finder/cloudfront.rb
@@ -598,6 +608,7 @@ files:
598
608
  - lib/awspec/matcher/be_opened.rb
599
609
  - lib/awspec/matcher/be_opened_only.rb
600
610
  - lib/awspec/matcher/belong_to_alb.rb
611
+ - lib/awspec/matcher/belong_to_backup_plan.rb
601
612
  - lib/awspec/matcher/belong_to_cache_subnet_group.rb
602
613
  - lib/awspec/matcher/belong_to_cluster_subnet_group.rb
603
614
  - lib/awspec/matcher/belong_to_db_subnet_group.rb
@@ -646,6 +657,9 @@ files:
646
657
  - lib/awspec/stub/ami.rb
647
658
  - lib/awspec/stub/apigateway.rb
648
659
  - lib/awspec/stub/autoscaling_group.rb
660
+ - lib/awspec/stub/backup_plan.rb
661
+ - lib/awspec/stub/backup_selection.rb
662
+ - lib/awspec/stub/backup_vault.rb
649
663
  - lib/awspec/stub/batch_compute_environment.rb
650
664
  - lib/awspec/stub/batch_job_definition.rb
651
665
  - lib/awspec/stub/batch_job_queue.rb
@@ -734,6 +748,7 @@ files:
734
748
  - lib/awspec/stub/waf_web_acl.rb
735
749
  - lib/awspec/stub/wafregional_web_acl.rb
736
750
  - lib/awspec/stub/wafv2_ip_set.rb
751
+ - lib/awspec/stub/wafv2_web_acl.rb
737
752
  - lib/awspec/toolbox.rb
738
753
  - lib/awspec/type/account.rb
739
754
  - lib/awspec/type/account_attribute.rb
@@ -745,6 +760,9 @@ files:
745
760
  - lib/awspec/type/ami.rb
746
761
  - lib/awspec/type/apigateway.rb
747
762
  - lib/awspec/type/autoscaling_group.rb
763
+ - lib/awspec/type/backup_plan.rb
764
+ - lib/awspec/type/backup_selection.rb
765
+ - lib/awspec/type/backup_vault.rb
748
766
  - lib/awspec/type/base.rb
749
767
  - lib/awspec/type/batch_compute_environment.rb
750
768
  - lib/awspec/type/batch_job_definition.rb
@@ -834,6 +852,7 @@ files:
834
852
  - lib/awspec/type/waf_web_acl.rb
835
853
  - lib/awspec/type/wafregional_web_acl.rb
836
854
  - lib/awspec/type/wafv2_ip_set.rb
855
+ - lib/awspec/type/wafv2_web_acl.rb
837
856
  - lib/awspec/version.rb
838
857
  homepage: https://github.com/k1LoW/awspec
839
858
  licenses: