awspec 1.31.0 → 1.32.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 +4 -4
- data/.rubocop.yml +1 -0
- data/doc/_resource_types/codedeploy.md +6 -0
- data/doc/_resource_types/codepipeline.md +7 -0
- data/doc/_resource_types/wafv2_ip_set.md +17 -0
- data/doc/resource_types.md +45 -0
- data/lib/awspec/command/generate.rb +12 -0
- data/lib/awspec/generator/doc/type/codepipeline.rb +19 -0
- data/lib/awspec/generator/doc/type/wafv2_ip_set.rb +19 -0
- data/lib/awspec/generator/spec/codepipeline.rb +29 -0
- data/lib/awspec/generator/spec/wafv2_ip_set.rb +35 -0
- data/lib/awspec/generator.rb +2 -0
- data/lib/awspec/helper/finder/codepipeline.rb +25 -0
- data/lib/awspec/helper/finder/vpc_endpoints.rb +2 -2
- data/lib/awspec/helper/finder/wafv2.rb +27 -0
- data/lib/awspec/helper/finder.rb +7 -1
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/shared_context.rb +6 -0
- data/lib/awspec/stub/cloudfront_distribution.rb +0 -2
- data/lib/awspec/stub/codepipeline.rb +104 -0
- data/lib/awspec/stub/wafv2_ip_set.rb +32 -0
- data/lib/awspec/type/codepipeline.rb +13 -0
- data/lib/awspec/type/wafv2_ip_set.rb +23 -0
- data/lib/awspec/version.rb +1 -1
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fda6baa9048249f77fa2fbc686a010ce8c64f9a2cc950707d6dacb99c2a352d
|
4
|
+
data.tar.gz: 9b52e0bd5e2d586207a4be29d37321158f037af215615ce791797e43cd118569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fcf1543ec18e1fe32468e48d20df072a5a53e1ef90394b451e4a383f438d49c167ba3a041073a0a118ffd46bd031ca547583732ec9d0254fb806f711f72d546
|
7
|
+
data.tar.gz: 7b6b59e791056334e52ad28da2ab62cf95cd7703e3e026a82d518ec0b1f1017c1aa7434ed1cb568879a544ab09bdb14f7cc0dbd3cd051df21f02a529e83f7286
|
data/.rubocop.yml
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
### exist
|
2
|
+
|
3
|
+
You can set `scope` to CLOUDFRONT or REGIONAL ( default: `REGIONAL` ).
|
4
|
+
|
5
|
+
```ruby
|
6
|
+
describe wafv2_ip_set('my-ip-set'), scope: 'REGIONAL' do
|
7
|
+
it { should exist }
|
8
|
+
end
|
9
|
+
```
|
10
|
+
|
11
|
+
### have_ip_address
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
describe wafv2_ip_set('my-ip-set'), scope: 'REGIONAL' do
|
15
|
+
it { should have_ip_address('10.0.0.0/32') }
|
16
|
+
end
|
17
|
+
```
|
data/doc/resource_types.md
CHANGED
@@ -19,6 +19,7 @@
|
|
19
19
|
| [codebuild](#codebuild)
|
20
20
|
| [codedeploy](#codedeploy)
|
21
21
|
| [codedeploy_deployment_group](#codedeploy_deployment_group)
|
22
|
+
| [codepipeline](#codepipeline)
|
22
23
|
| [cognito_identity_pool](#cognito_identity_pool)
|
23
24
|
| [cognito_user_pool](#cognito_user_pool)
|
24
25
|
| [customer_gateway](#customer_gateway)
|
@@ -88,6 +89,7 @@
|
|
88
89
|
| [vpn_gateway](#vpn_gateway)
|
89
90
|
| [waf_web_acl](#waf_web_acl)
|
90
91
|
| [wafregional_web_acl](#wafregional_web_acl)
|
92
|
+
| [wafv2_ip_set](#wafv2_ip_set)
|
91
93
|
| [account](#account)
|
92
94
|
|
93
95
|
## <a name="acm">acm</a>
|
@@ -759,6 +761,12 @@ Codedeploy resource type.
|
|
759
761
|
|
760
762
|
### exist
|
761
763
|
|
764
|
+
```ruby
|
765
|
+
describe codedeploy('my-codedeploy') do
|
766
|
+
it { should exist }
|
767
|
+
end
|
768
|
+
```
|
769
|
+
|
762
770
|
### its(:application_id), its(:application_name), its(:create_time), its(:linked_to_git_hub), its(:git_hub_account_name), its(:compute_platform)
|
763
771
|
## <a name="codedeploy_deployment_group">codedeploy_deployment_group</a>
|
764
772
|
|
@@ -784,6 +792,19 @@ end
|
|
784
792
|
```
|
785
793
|
|
786
794
|
### its(:application_name), its(:deployment_group_id), its(:deployment_group_name), its(:deployment_config_name), its(:on_premises_instance_tag_filters), its(:service_role_arn), its(:target_revision), its(:trigger_configurations), its(:alarm_configuration), its(:deployment_style), its(:outdated_instances_strategy), its(:load_balancer_info), its(:last_successful_deployment), its(:last_attempted_deployment), its(:ec2_tag_set), its(:on_premises_tag_set), its(:compute_platform), its(:ecs_services), its(:termination_hook_enabled)
|
795
|
+
## <a name="codepipeline">codepipeline</a>
|
796
|
+
|
797
|
+
Codepipeline resource type.
|
798
|
+
|
799
|
+
### exist
|
800
|
+
|
801
|
+
```ruby
|
802
|
+
describe codepipeline('my-codepipeline') do
|
803
|
+
it { should exist }
|
804
|
+
end
|
805
|
+
```
|
806
|
+
|
807
|
+
### its(:name), its(:role_arn), its(:artifact_stores), its(:version), its(:execution_mode), its(:pipeline_type), its(:variables), its(:triggers)
|
787
808
|
## <a name="cognito_identity_pool">cognito_identity_pool</a>
|
788
809
|
|
789
810
|
CognitoIdentityPool resource type.
|
@@ -4280,6 +4301,30 @@ end
|
|
4280
4301
|
|
4281
4302
|
|
4282
4303
|
### its(:default_action), its(:web_acl_id), its(:name), its(:metric_name), its(:web_acl_arn)
|
4304
|
+
## <a name="wafv2_ip_set">wafv2_ip_set</a>
|
4305
|
+
|
4306
|
+
Wafv2IpSet resource type.
|
4307
|
+
|
4308
|
+
### exist
|
4309
|
+
|
4310
|
+
You can set `scope` to CLOUDFRONT or REGIONAL ( default: `REGIONAL` ).
|
4311
|
+
|
4312
|
+
```ruby
|
4313
|
+
describe wafv2_ip_set('my-ip-set'), scope: 'REGIONAL' do
|
4314
|
+
it { should exist }
|
4315
|
+
end
|
4316
|
+
```
|
4317
|
+
|
4318
|
+
|
4319
|
+
### have_ip_address
|
4320
|
+
|
4321
|
+
```ruby
|
4322
|
+
describe wafv2_ip_set('my-ip-set'), scope: 'REGIONAL' do
|
4323
|
+
it { should have_ip_address('10.0.0.0/32') }
|
4324
|
+
end
|
4325
|
+
```
|
4326
|
+
|
4327
|
+
### its(:name), its(:id), its(:arn), its(:description), its(:ip_address_version), its(:addresses)
|
4283
4328
|
# Account and Attributes
|
4284
4329
|
|
4285
4330
|
## <a name="account">account</a>
|
@@ -62,6 +62,18 @@ module Awspec
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
types = %w[
|
66
|
+
wafv2_ip_set
|
67
|
+
]
|
68
|
+
|
69
|
+
types.each do |type|
|
70
|
+
desc "#{type} [scope]", "Generate #{type} spec from scope: (CLOUDFRONT or REGIONAL)."
|
71
|
+
define_method type do |_scope|
|
72
|
+
Awsecrets.load(profile: options[:profile], region: options[:region], secrets_path: options[:secrets_path])
|
73
|
+
eval "puts Awspec::Generator::Spec::#{type.camelize}.new.generate_by_scope(_scope)"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
65
77
|
types_for_generate_all = %w[
|
66
78
|
cloudwatch_alarm cloudwatch_event directconnect ebs efs
|
67
79
|
elasticsearch iam_group iam_policy iam_role iam_user kms lambda
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Generator
|
4
|
+
module Doc
|
5
|
+
module Type
|
6
|
+
class Codepipeline < Base
|
7
|
+
def initialize
|
8
|
+
super
|
9
|
+
@type_name = 'Codepipeline'
|
10
|
+
@type = Awspec::Type::Codepipeline.new('my-codepipeline')
|
11
|
+
@ret = @type.resource_via_client
|
12
|
+
@matchers = []
|
13
|
+
@ignore_matchers = []
|
14
|
+
@describes = []
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Generator
|
4
|
+
module Doc
|
5
|
+
module Type
|
6
|
+
class Wafv2IpSet < Base
|
7
|
+
def initialize
|
8
|
+
super
|
9
|
+
@type_name = 'Wafv2IpSet'
|
10
|
+
@type = Awspec::Type::Wafv2IpSet.new('my-ip-set')
|
11
|
+
@ret = @type.resource_via_client
|
12
|
+
@matchers = []
|
13
|
+
@ignore_matchers = []
|
14
|
+
@describes = []
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Generator
|
4
|
+
module Spec
|
5
|
+
class Codepipeline
|
6
|
+
include Awspec::Helper::Finder
|
7
|
+
def generate_all
|
8
|
+
pipelines = select_all_codepipelines
|
9
|
+
raise 'Not Found CodePipeline' if pipelines.empty?
|
10
|
+
|
11
|
+
ERB.new(codepipeline_spec_template, nil, '-').result(binding).chomp
|
12
|
+
end
|
13
|
+
|
14
|
+
def codepipeline_spec_template
|
15
|
+
<<-'EOF'
|
16
|
+
<% pipelines.each do |pipeline| %>
|
17
|
+
describe codepipeline('<%= pipeline.name %>') do
|
18
|
+
it { should exist }
|
19
|
+
its(:name) { should eq '<%= pipeline.name %>' }
|
20
|
+
its(:version) { should eq <%= pipeline.version %> }
|
21
|
+
its(:pipeline_type) { should eq '<%= pipeline.pipeline_type %>' }
|
22
|
+
its(:execution_mode) { should eq '<%= pipeline.execution_mode %>' }
|
23
|
+
end
|
24
|
+
<% end %>
|
25
|
+
EOF
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Generator
|
4
|
+
module Spec
|
5
|
+
class Wafv2IpSet
|
6
|
+
include Awspec::Helper::Finder
|
7
|
+
def generate_by_scope(scope)
|
8
|
+
ip_sets = select_all_ip_sets(scope)
|
9
|
+
raise 'Not Found WAFV2 IP sets' if ip_sets.empty?
|
10
|
+
|
11
|
+
specs = ip_sets.map do |i|
|
12
|
+
ip_set = get_ip_set(scope, i.name, i.id)
|
13
|
+
ERB.new(wafv2_ip_set_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
|
14
|
+
end
|
15
|
+
specs.join("\n")
|
16
|
+
end
|
17
|
+
|
18
|
+
def wafv2_ip_set_spec_template
|
19
|
+
<<-'EOF'
|
20
|
+
describe wafv2_ip_set('<%= ip_set.name %>'), scope: '<%= scope %>' do
|
21
|
+
it { should exist }
|
22
|
+
its(:name) { should eq '<%= ip_set.name %>' }
|
23
|
+
its(:id) { should eq '<%= ip_set.id %>' }
|
24
|
+
its(:arn) { should eq '<%= ip_set.arn %>' }
|
25
|
+
its(:description) { should eq '<%= ip_set.description %>' }
|
26
|
+
its(:ip_address_version) { should eq '<%= ip_set.ip_address_version %>' }
|
27
|
+
<% ip_set.addresses.each do |address| %>
|
28
|
+
it { should have_ip_address('<%= address %>') }
|
29
|
+
<% end %>
|
30
|
+
end
|
31
|
+
EOF
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/awspec/generator.rb
CHANGED
@@ -44,6 +44,8 @@ require 'awspec/generator/spec/rds_proxy'
|
|
44
44
|
require 'awspec/generator/spec/rds_db_cluster'
|
45
45
|
require 'awspec/generator/spec/rds_global_cluster'
|
46
46
|
require 'awspec/generator/spec/managed_prefix_list'
|
47
|
+
require 'awspec/generator/spec/codepipeline'
|
48
|
+
require 'awspec/generator/spec/wafv2_ip_set'
|
47
49
|
|
48
50
|
# Doc
|
49
51
|
require 'awspec/generator/doc/type'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Helper
|
4
|
+
module Finder
|
5
|
+
module Codepipeline
|
6
|
+
def find_codepipeline(id)
|
7
|
+
res = codepipeline_client.get_pipeline({ name: id })
|
8
|
+
res.pipeline
|
9
|
+
end
|
10
|
+
|
11
|
+
def select_all_codepipelines
|
12
|
+
req = {}
|
13
|
+
pipelines = []
|
14
|
+
loop do
|
15
|
+
res = codepipeline_client.list_pipelines(req)
|
16
|
+
pipelines.push(*res.pipelines)
|
17
|
+
break if res.next_token.nil?
|
18
|
+
|
19
|
+
req[:next_token] = res.next_token
|
20
|
+
end
|
21
|
+
pipelines
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -11,8 +11,8 @@ module Awspec::Helper
|
|
11
11
|
end
|
12
12
|
|
13
13
|
resource = ret.single_resource(id)
|
14
|
-
|
15
|
-
|
14
|
+
resource if resource
|
15
|
+
rescue Aws::EC2::Errors::InvalidVpcEndpointIdNotFound, Aws::EC2::Errors::InvalidVpcEndpointIdMalformed
|
16
16
|
res = ec2_client.describe_vpc_endpoints({
|
17
17
|
filters: [{ name: 'tag:Name', values: [id] }]
|
18
18
|
})
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Helper
|
4
|
+
module Finder
|
5
|
+
module Wafv2
|
6
|
+
def find_ip_set(scope, name)
|
7
|
+
ip_sets = select_all_ip_sets(scope)
|
8
|
+
ip_set = ip_sets.find do |i|
|
9
|
+
i.name == name
|
10
|
+
end
|
11
|
+
return false unless ip_set
|
12
|
+
|
13
|
+
get_ip_set(scope, name, ip_set.id)
|
14
|
+
end
|
15
|
+
|
16
|
+
def select_all_ip_sets(scope)
|
17
|
+
res = wafv2_client.list_ip_sets({ scope: scope })
|
18
|
+
res.ip_sets
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_ip_set(scope, name, id)
|
22
|
+
res = wafv2_client.get_ip_set({ name: name, scope: scope, id: id })
|
23
|
+
res.ip_set
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/awspec/helper/finder.rb
CHANGED
@@ -55,6 +55,8 @@ require 'awspec/helper/finder/cognito_user_pool'
|
|
55
55
|
require 'awspec/helper/finder/msk'
|
56
56
|
require 'awspec/helper/finder/cognito_identity_pool'
|
57
57
|
require 'awspec/helper/finder/transfer'
|
58
|
+
require 'awspec/helper/finder/codepipeline'
|
59
|
+
require 'awspec/helper/finder/wafv2'
|
58
60
|
|
59
61
|
require 'awspec/helper/finder/account_attributes'
|
60
62
|
|
@@ -117,6 +119,8 @@ module Awspec::Helper
|
|
117
119
|
include Awspec::Helper::Finder::Msk
|
118
120
|
include Awspec::Helper::Finder::CognitoIdentityPool
|
119
121
|
include Awspec::Helper::Finder::Transfer
|
122
|
+
include Awspec::Helper::Finder::Codepipeline
|
123
|
+
include Awspec::Helper::Finder::Wafv2
|
120
124
|
|
121
125
|
CLIENTS = {
|
122
126
|
ec2_client: Aws::EC2::Client,
|
@@ -165,7 +169,9 @@ module Awspec::Helper
|
|
165
169
|
msk_client: Aws::Kafka::Client,
|
166
170
|
cognito_identity_client: Aws::CognitoIdentity::Client,
|
167
171
|
cognito_identity_provider_client: Aws::CognitoIdentityProvider::Client,
|
168
|
-
transfer_client: Aws::Transfer::Client
|
172
|
+
transfer_client: Aws::Transfer::Client,
|
173
|
+
codepipeline_client: Aws::CodePipeline::Client,
|
174
|
+
wafv2_client: Aws::WAFV2::Client
|
169
175
|
}
|
170
176
|
|
171
177
|
CLIENT_OPTIONS = {
|
data/lib/awspec/helper/type.rb
CHANGED
@@ -24,7 +24,7 @@ module Awspec
|
|
24
24
|
internet_gateway acm cloudwatch_logs dynamodb_table eip sqs ssm_parameter cloudformation_stack
|
25
25
|
codebuild sns_topic redshift redshift_cluster_parameter_group codedeploy codedeploy_deployment_group
|
26
26
|
secretsmanager msk transit_gateway cognito_identity_pool cognito_user_pool vpc_endpoints
|
27
|
-
transfer_server managed_prefix_list
|
27
|
+
transfer_server managed_prefix_list codepipeline wafv2_ip_set
|
28
28
|
]
|
29
29
|
|
30
30
|
ACCOUNT_ATTRIBUTES = %w[
|
@@ -38,3 +38,9 @@ shared_context 'application_name', :application_name do
|
|
38
38
|
example.metadata[:described_class].application_name = example.metadata[:application_name]
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
shared_context 'scope', :scope do
|
43
|
+
before do |example|
|
44
|
+
example.metadata[:described_class].scope = example.metadata[:scope]
|
45
|
+
end
|
46
|
+
end
|
@@ -17,7 +17,6 @@ Aws.config[:cloudfront] = {
|
|
17
17
|
status: 'Deployed',
|
18
18
|
last_modified_time: Time.new(2015, 1, 2, 10, 00, 00, '+00:00'),
|
19
19
|
domain_name: 'abcdefghijklmn.cloudfront.net',
|
20
|
-
staging: false,
|
21
20
|
aliases: {
|
22
21
|
quantity: 0,
|
23
22
|
items: []
|
@@ -117,7 +116,6 @@ Aws.config[:cloudfront] = {
|
|
117
116
|
status: 'Deployed',
|
118
117
|
last_modified_time: Time.new(2016, 3, 2, 10, 00, 00, '+00:00'),
|
119
118
|
domain_name: '123456789zyxw.cloudfront.net',
|
120
|
-
staging: false,
|
121
119
|
aliases: {
|
122
120
|
quantity: 1,
|
123
121
|
items: ['cf-s3-origin-hosting.dev.example.com']
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Aws.config[:codepipeline] = {
|
4
|
+
stub_responses: {
|
5
|
+
get_pipeline: {
|
6
|
+
pipeline: {
|
7
|
+
name: 'my-codepipeline',
|
8
|
+
role_arn: 'arn:aws:iam::123456789012:role/service-role/AWSCodePipelineServiceRole-my-codepipeline',
|
9
|
+
artifact_store: {
|
10
|
+
type: 'S3',
|
11
|
+
location: 'codepipeline-ap-northeast-1-12345678901'
|
12
|
+
},
|
13
|
+
stages: [
|
14
|
+
{
|
15
|
+
name: 'Source',
|
16
|
+
actions: [
|
17
|
+
{
|
18
|
+
name: 'Source',
|
19
|
+
action_type_id: {
|
20
|
+
category: 'Source',
|
21
|
+
owner: 'AWS',
|
22
|
+
provider: 'S3',
|
23
|
+
version: '1'
|
24
|
+
},
|
25
|
+
run_order: 1,
|
26
|
+
configuration: {
|
27
|
+
'PollForSourceChanges' => 'false',
|
28
|
+
'S3Bucket' => 'example-bucket',
|
29
|
+
'S3ObjectKey' => 'test.zip'
|
30
|
+
},
|
31
|
+
output_artifacts: [
|
32
|
+
{
|
33
|
+
name: 'SourceArtifact'
|
34
|
+
}
|
35
|
+
],
|
36
|
+
input_artifacts: [],
|
37
|
+
region: 'ap-northeast-1',
|
38
|
+
namespace: 'SourceVariables'
|
39
|
+
}
|
40
|
+
]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
name: 'Build',
|
44
|
+
actions: [
|
45
|
+
{
|
46
|
+
name: 'Build',
|
47
|
+
action_type_id: {
|
48
|
+
category: 'Build',
|
49
|
+
owner: 'AWS',
|
50
|
+
provider: 'CodeBuild',
|
51
|
+
version: '1'
|
52
|
+
},
|
53
|
+
run_order: 1,
|
54
|
+
configuration: {
|
55
|
+
'ProjectName' => 'my-codebuild1'
|
56
|
+
},
|
57
|
+
output_artifacts: [
|
58
|
+
{
|
59
|
+
name: 'BuildArtifact'
|
60
|
+
}
|
61
|
+
],
|
62
|
+
input_artifacts: [
|
63
|
+
{
|
64
|
+
name: 'SourceArtifact'
|
65
|
+
}
|
66
|
+
],
|
67
|
+
region: 'ap-northeast-1',
|
68
|
+
namespace: 'BuildVariables'
|
69
|
+
}
|
70
|
+
]
|
71
|
+
}
|
72
|
+
],
|
73
|
+
version: 1,
|
74
|
+
execution_mode: 'QUEUED',
|
75
|
+
pipeline_type: 'V2'
|
76
|
+
},
|
77
|
+
metadata: {
|
78
|
+
pipeline_arn: 'arn:aws:codepipeline:ap-northeast-1:123456789012:my-codepipeline',
|
79
|
+
created: Time.local(2024),
|
80
|
+
updated: Time.local(2024)
|
81
|
+
}
|
82
|
+
},
|
83
|
+
list_pipelines: {
|
84
|
+
pipelines: [
|
85
|
+
{
|
86
|
+
name: 'my-codepipeline1',
|
87
|
+
version: 1,
|
88
|
+
pipeline_type: 'V2',
|
89
|
+
execution_mode: 'QUEUED',
|
90
|
+
created: Time.local(2024),
|
91
|
+
updated: Time.local(2024)
|
92
|
+
},
|
93
|
+
{
|
94
|
+
name: 'my-codepipeline2',
|
95
|
+
version: 1,
|
96
|
+
pipeline_type: 'V2',
|
97
|
+
execution_mode: 'QUEUED',
|
98
|
+
created: Time.local(2024),
|
99
|
+
updated: Time.local(2024)
|
100
|
+
}
|
101
|
+
]
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Aws.config[:wafv2] = {
|
4
|
+
stub_responses: {
|
5
|
+
get_ip_set: {
|
6
|
+
ip_set: {
|
7
|
+
name: 'my-ip-set',
|
8
|
+
id: '01234567-89ab-cdef-0123-456789abcdef',
|
9
|
+
arn: 'arn:aws:wafv2:ap-northeast-1:123456789012:regional/ipset/my-ip-set/01234567-89ab-cdef-0123-456789abcdef',
|
10
|
+
description: 'dev ips',
|
11
|
+
ip_address_version: 'IPV4',
|
12
|
+
addresses: [
|
13
|
+
'10.0.0.0/32',
|
14
|
+
'10.0.0.1/32'
|
15
|
+
]
|
16
|
+
},
|
17
|
+
lock_token: '01234567-89ab-cdef-0123456789abcdef0'
|
18
|
+
},
|
19
|
+
list_ip_sets: {
|
20
|
+
next_marker: 'my-ip-set',
|
21
|
+
ip_sets: [
|
22
|
+
{
|
23
|
+
name: 'my-ip-set',
|
24
|
+
id: '01234567-89ab-cdef-0123-456789abcdef',
|
25
|
+
description: 'dev ips',
|
26
|
+
lock_token: '01234567-89ab-cdef-0123456789abcdef0',
|
27
|
+
arn: 'arn:aws:wafv2:ap-northeast-1:123456789012:regional/ipset/my-ip-set/01234567-89ab-cdef-0123-456789abcdef'
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Type
|
4
|
+
class Codepipeline < ResourceBase
|
5
|
+
def resource_via_client
|
6
|
+
@resource_via_client ||= find_codepipeline(@display_name)
|
7
|
+
end
|
8
|
+
|
9
|
+
def id
|
10
|
+
@id ||= resource_via_client if resource_via_client.name
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Awspec::Type
|
4
|
+
class Wafv2IpSet < ResourceBase
|
5
|
+
attr_accessor :scope
|
6
|
+
|
7
|
+
def resource_via_client
|
8
|
+
@resource_via_client ||= find_ip_set(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 has_ip_address?(ip_address)
|
20
|
+
resource_via_client.addresses.include?(ip_address)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/awspec/version.rb
CHANGED
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.
|
4
|
+
version: 1.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-28 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: addressable
|
@@ -292,6 +292,7 @@ files:
|
|
292
292
|
- doc/_resource_types/codebuild.md
|
293
293
|
- doc/_resource_types/codedeploy.md
|
294
294
|
- doc/_resource_types/codedeploy_deployment_group.md
|
295
|
+
- doc/_resource_types/codepipeline.md
|
295
296
|
- doc/_resource_types/cognito_identity_pool.md
|
296
297
|
- doc/_resource_types/cognito_user_pool.md
|
297
298
|
- doc/_resource_types/customer_gateway.md
|
@@ -365,6 +366,7 @@ files:
|
|
365
366
|
- doc/_resource_types/vpn_gateway.md
|
366
367
|
- doc/_resource_types/waf_web_acl.md
|
367
368
|
- doc/_resource_types/wafregional_web_acl.md
|
369
|
+
- doc/_resource_types/wafv2_ip_set.md
|
368
370
|
- doc/contributing.md
|
369
371
|
- doc/resource_types.md
|
370
372
|
- exe/awspec
|
@@ -403,6 +405,7 @@ files:
|
|
403
405
|
- lib/awspec/generator/doc/type/codebuild.rb
|
404
406
|
- lib/awspec/generator/doc/type/codedeploy.rb
|
405
407
|
- lib/awspec/generator/doc/type/codedeploy_deployment_group.rb
|
408
|
+
- lib/awspec/generator/doc/type/codepipeline.rb
|
406
409
|
- lib/awspec/generator/doc/type/cognito_identity_pool.rb
|
407
410
|
- lib/awspec/generator/doc/type/cognito_user_pool.rb
|
408
411
|
- lib/awspec/generator/doc/type/customer_gateway.rb
|
@@ -476,6 +479,7 @@ files:
|
|
476
479
|
- lib/awspec/generator/doc/type/vpn_gateway.rb
|
477
480
|
- lib/awspec/generator/doc/type/waf_web_acl.rb
|
478
481
|
- lib/awspec/generator/doc/type/wafregional_web_acl.rb
|
482
|
+
- lib/awspec/generator/doc/type/wafv2_ip_set.rb
|
479
483
|
- lib/awspec/generator/spec/acm.rb
|
480
484
|
- lib/awspec/generator/spec/alb.rb
|
481
485
|
- lib/awspec/generator/spec/alb_listener.rb
|
@@ -484,6 +488,7 @@ files:
|
|
484
488
|
- lib/awspec/generator/spec/cloudwatch_event.rb
|
485
489
|
- lib/awspec/generator/spec/cloudwatch_logs.rb
|
486
490
|
- lib/awspec/generator/spec/codebuild.rb
|
491
|
+
- lib/awspec/generator/spec/codepipeline.rb
|
487
492
|
- lib/awspec/generator/spec/directconnect.rb
|
488
493
|
- lib/awspec/generator/spec/ebs.rb
|
489
494
|
- lib/awspec/generator/spec/ec2.rb
|
@@ -519,6 +524,7 @@ files:
|
|
519
524
|
- lib/awspec/generator/spec/security_group.rb
|
520
525
|
- lib/awspec/generator/spec/subnet.rb
|
521
526
|
- lib/awspec/generator/spec/vpc.rb
|
527
|
+
- lib/awspec/generator/spec/wafv2_ip_set.rb
|
522
528
|
- lib/awspec/generator/template.rb
|
523
529
|
- lib/awspec/helper.rb
|
524
530
|
- lib/awspec/helper/client_wrap.rb
|
@@ -539,6 +545,7 @@ files:
|
|
539
545
|
- lib/awspec/helper/finder/cloudwatch_logs.rb
|
540
546
|
- lib/awspec/helper/finder/codebuild.rb
|
541
547
|
- lib/awspec/helper/finder/codedeploy.rb
|
548
|
+
- lib/awspec/helper/finder/codepipeline.rb
|
542
549
|
- lib/awspec/helper/finder/cognito_identity_pool.rb
|
543
550
|
- lib/awspec/helper/finder/cognito_user_pool.rb
|
544
551
|
- lib/awspec/helper/finder/directconnect.rb
|
@@ -579,6 +586,7 @@ files:
|
|
579
586
|
- lib/awspec/helper/finder/vpc_endpoints.rb
|
580
587
|
- lib/awspec/helper/finder/waf.rb
|
581
588
|
- lib/awspec/helper/finder/wafregional.rb
|
589
|
+
- lib/awspec/helper/finder/wafv2.rb
|
582
590
|
- lib/awspec/helper/states.rb
|
583
591
|
- lib/awspec/helper/type.rb
|
584
592
|
- lib/awspec/matcher.rb
|
@@ -650,6 +658,7 @@ files:
|
|
650
658
|
- lib/awspec/stub/codebuild.rb
|
651
659
|
- lib/awspec/stub/codedeploy.rb
|
652
660
|
- lib/awspec/stub/codedeploy_deployment_group.rb
|
661
|
+
- lib/awspec/stub/codepipeline.rb
|
653
662
|
- lib/awspec/stub/cognito_identity_pool.rb
|
654
663
|
- lib/awspec/stub/cognito_user_pool.rb
|
655
664
|
- lib/awspec/stub/customer_gateway.rb
|
@@ -724,6 +733,7 @@ files:
|
|
724
733
|
- lib/awspec/stub/vpn_gateway.rb
|
725
734
|
- lib/awspec/stub/waf_web_acl.rb
|
726
735
|
- lib/awspec/stub/wafregional_web_acl.rb
|
736
|
+
- lib/awspec/stub/wafv2_ip_set.rb
|
727
737
|
- lib/awspec/toolbox.rb
|
728
738
|
- lib/awspec/type/account.rb
|
729
739
|
- lib/awspec/type/account_attribute.rb
|
@@ -748,6 +758,7 @@ files:
|
|
748
758
|
- lib/awspec/type/codebuild.rb
|
749
759
|
- lib/awspec/type/codedeploy.rb
|
750
760
|
- lib/awspec/type/codedeploy_deployment_group.rb
|
761
|
+
- lib/awspec/type/codepipeline.rb
|
751
762
|
- lib/awspec/type/cognito_identity_pool.rb
|
752
763
|
- lib/awspec/type/cognito_user_pool.rb
|
753
764
|
- lib/awspec/type/customer_gateway.rb
|
@@ -822,6 +833,7 @@ files:
|
|
822
833
|
- lib/awspec/type/vpn_gateway.rb
|
823
834
|
- lib/awspec/type/waf_web_acl.rb
|
824
835
|
- lib/awspec/type/wafregional_web_acl.rb
|
836
|
+
- lib/awspec/type/wafv2_ip_set.rb
|
825
837
|
- lib/awspec/version.rb
|
826
838
|
homepage: https://github.com/k1LoW/awspec
|
827
839
|
licenses:
|