awspec 1.28.1 → 1.28.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/_resource_types/s3_bucket.md +1 -1
- data/doc/_resource_types/vpc_endpoints.md +1 -0
- data/doc/_resource_types/vpn_gateway.md +8 -1
- data/doc/resource_types.md +16 -6
- data/lib/awspec/generator/doc/type/vpc_endpoints.rb +1 -1
- data/lib/awspec/generator/doc/type/vpn_gateway.rb +2 -1
- data/lib/awspec/helper/finder/ec2.rb +10 -6
- data/lib/awspec/helper/finder/eip.rb +2 -2
- data/lib/awspec/matcher/belong_to_domain.rb +1 -1
- data/lib/awspec/stub/vpn_gateway.rb +14 -1
- data/lib/awspec/type/eip.rb +5 -3
- data/lib/awspec/type/vpc_endpoints.rb +6 -0
- data/lib/awspec/type/vpn_gateway.rb +2 -10
- data/lib/awspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6f1ca2cbd7fc6f8da6c63b21580d6541b0537991e70b4fe6355206b4220d596
|
4
|
+
data.tar.gz: 6a63cd43a83035df50cde9861b13390807ed23e719e8823c1171b55f62c94491
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 241b78c9bd20ad9adba886717e3f95133c632e25b0dcedc2b86ec9c14f98a5a0c1a7f6a2cd1539ab63465e99490081b6e83c19847bb022280523f01231e5dfa0
|
7
|
+
data.tar.gz: 6b556cf9de7bc9c7ff171fe77ca28b7e21ee9d3ec3ee6428dc20205cea8fb85fde05f3307a8a8fc8a20cfdf47a980920b8fa0890a7736585070bc8fc2e1a6bd2
|
@@ -88,7 +88,7 @@ describe s3_bucket('my-bucket') do
|
|
88
88
|
it do
|
89
89
|
should have_lifecycle_rule(
|
90
90
|
id: 'MyRuleName2',
|
91
|
-
prefix: '123/',
|
91
|
+
filter: { prefix: '123/' },
|
92
92
|
noncurrent_version_expiration: { noncurrent_days: 2 },
|
93
93
|
expiration: { days: 3 },
|
94
94
|
transitions: [{ days: 5, storage_class: 'STANDARD_IA' }, { days: 10, storage_class: 'GLACIER' }],
|
@@ -22,4 +22,11 @@ describe vpn_gateway('my-vpn-gateway') do
|
|
22
22
|
end
|
23
23
|
```
|
24
24
|
|
25
|
-
###
|
25
|
+
### belong_to_vpc
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
describe vpn_gateway('my-vpn-gateway') do
|
29
|
+
it { should belong_to_vpc('vpc-ab123cde') }
|
30
|
+
it { should belong_to_vpc('my-vpc') }
|
31
|
+
end
|
32
|
+
```
|
data/doc/resource_types.md
CHANGED
@@ -278,7 +278,7 @@ end
|
|
278
278
|
|
279
279
|
### have_tag
|
280
280
|
|
281
|
-
### its(:architecture), its(:creation_date), its(:image_id), its(:image_location), its(:image_type), its(:public), its(:kernel_id), its(:owner_id), its(:platform), its(:platform_details), its(:usage_operation), its(:ramdisk_id), its(:state), its(:description), its(:ena_support), its(:hypervisor), its(:image_owner_alias), its(:name), its(:root_device_name), its(:root_device_type), its(:sriov_net_support), its(:state_reason), its(:virtualization_type), its(:boot_mode), its(:tpm_support), its(:deprecation_time)
|
281
|
+
### its(:architecture), its(:creation_date), its(:image_id), its(:image_location), its(:image_type), its(:public), its(:kernel_id), its(:owner_id), its(:platform), its(:platform_details), its(:usage_operation), its(:ramdisk_id), its(:state), its(:description), its(:ena_support), its(:hypervisor), its(:image_owner_alias), its(:name), its(:root_device_name), its(:root_device_type), its(:sriov_net_support), its(:state_reason), its(:virtualization_type), its(:boot_mode), its(:tpm_support), its(:deprecation_time), its(:imds_support)
|
282
282
|
### :unlock: Advanced use
|
283
283
|
|
284
284
|
`ami` can use `Aws::EC2::Image` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Image.html).
|
@@ -1359,7 +1359,7 @@ describe eip('123.0.456.789') do
|
|
1359
1359
|
end
|
1360
1360
|
```
|
1361
1361
|
|
1362
|
-
|
1362
|
+
### its(:instance_id), its(:public_ip), its(:allocation_id), its(:association_id), its(:domain), its(:network_interface_id), its(:network_interface_owner_id), its(:private_ip_address), its(:public_ipv_4_pool), its(:network_border_group), its(:customer_owned_ip), its(:customer_owned_ipv_4_pool), its(:carrier_ip)
|
1363
1363
|
## <a name="eks">eks</a>
|
1364
1364
|
|
1365
1365
|
Eks resource type.
|
@@ -1380,7 +1380,7 @@ describe eks('my-eks') do
|
|
1380
1380
|
end
|
1381
1381
|
```
|
1382
1382
|
|
1383
|
-
### its(:name), its(:arn), its(:created_at), its(:version), its(:endpoint), its(:role_arn), its(:kubernetes_network_config), its(:logging), its(:identity), its(:status), its(:client_request_token), its(:platform_version), its(:tags), its(:encryption_config), its(:connector_config)
|
1383
|
+
### its(:name), its(:arn), its(:created_at), its(:version), its(:endpoint), its(:role_arn), its(:kubernetes_network_config), its(:logging), its(:identity), its(:status), its(:client_request_token), its(:platform_version), its(:tags), its(:encryption_config), its(:connector_config), its(:id), its(:health), its(:outpost_config)
|
1384
1384
|
## <a name="eks_nodegroup">eks_nodegroup</a>
|
1385
1385
|
|
1386
1386
|
EksNodegroup resource type.
|
@@ -3370,7 +3370,7 @@ describe s3_bucket('my-bucket') do
|
|
3370
3370
|
it do
|
3371
3371
|
should have_lifecycle_rule(
|
3372
3372
|
id: 'MyRuleName2',
|
3373
|
-
prefix: '123/',
|
3373
|
+
filter: { prefix: '123/' },
|
3374
3374
|
noncurrent_version_expiration: { noncurrent_days: 2 },
|
3375
3375
|
expiration: { days: 3 },
|
3376
3376
|
transitions: [{ days: 5, storage_class: 'STANDARD_IA' }, { days: 10, storage_class: 'GLACIER' }],
|
@@ -4001,6 +4001,7 @@ end
|
|
4001
4001
|
```ruby
|
4002
4002
|
describe vpc_endpoints('my-vpc-endpoint') do
|
4003
4003
|
it { should have_subnet('subnet-abc123') }
|
4004
|
+
it { should have_subnet('my-subnet') }
|
4004
4005
|
end
|
4005
4006
|
```
|
4006
4007
|
|
@@ -4023,7 +4024,7 @@ end
|
|
4023
4024
|
```
|
4024
4025
|
|
4025
4026
|
|
4026
|
-
|
4027
|
+
### its(:vpc_endpoint_id), its(:vpc_endpoint_type), its(:vpc_id), its(:service_name), its(:state), its(:policy_document), its(:route_table_ids), its(:subnet_ids), its(:groups), its(:ip_address_type), its(:dns_options), its(:private_dns_enabled), its(:requester_managed), its(:network_interface_ids), its(:dns_entries), its(:creation_timestamp), its(:owner_id), its(:last_error)
|
4027
4028
|
### :unlock: Advanced use
|
4028
4029
|
|
4029
4030
|
`vpc_endpoints` can use `Aws::EC2::Types::VpcEndpoint` resource (see https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/EC2/Types/VpcEndpoint.html).
|
@@ -4100,7 +4101,16 @@ end
|
|
4100
4101
|
```
|
4101
4102
|
|
4102
4103
|
|
4103
|
-
###
|
4104
|
+
### belong_to_vpc
|
4105
|
+
|
4106
|
+
```ruby
|
4107
|
+
describe vpn_gateway('my-vpn-gateway') do
|
4108
|
+
it { should belong_to_vpc('vpc-ab123cde') }
|
4109
|
+
it { should belong_to_vpc('my-vpc') }
|
4110
|
+
end
|
4111
|
+
```
|
4112
|
+
|
4113
|
+
### its(:availability_zone), its(:state), its(:type), its(:vpn_gateway_id), its(:amazon_side_asn)
|
4104
4114
|
## <a name="waf_web_acl">waf_web_acl</a>
|
4105
4115
|
|
4106
4116
|
WafWebAcl resource type.
|
@@ -7,7 +7,7 @@ module Awspec::Generator
|
|
7
7
|
def initialize
|
8
8
|
super
|
9
9
|
@type_name = 'VpcEndpoints'
|
10
|
-
@type = Awspec::Type::VpcEndpoints.new('
|
10
|
+
@type = Awspec::Type::VpcEndpoints.new('vpce-abc123')
|
11
11
|
@ret = @type.resource_via_client
|
12
12
|
@matchers = [
|
13
13
|
Awspec::Type::VpcEndpoints::STATES.map { |state| "be_#{state.tr('-', '_')}" }.join(', '),
|
@@ -10,7 +10,8 @@ module Awspec::Generator
|
|
10
10
|
@type = Awspec::Type::VpnGateway.new('my-vpn-gateway')
|
11
11
|
@ret = @type.resource_via_client
|
12
12
|
@matchers = [
|
13
|
-
Awspec::Type::VpnGateway::STATES.map { |state| "be_#{state.tr('-', '_')}" }.join(', ')
|
13
|
+
Awspec::Type::VpnGateway::STATES.map { |state| "be_#{state.tr('-', '_')}" }.join(', '),
|
14
|
+
'belong_to_vpc'
|
14
15
|
]
|
15
16
|
@ignore_matchers = Awspec::Type::VpnGateway::STATES.map { |state| "be_#{state.tr('-', '_')}" }
|
16
17
|
@describes = []
|
@@ -76,12 +76,16 @@ module Awspec::Helper
|
|
76
76
|
define_method "find_#{type}_gateway" do |*args|
|
77
77
|
gateway_id = args.first
|
78
78
|
method_name = "describe_#{type}_gateways"
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
79
|
+
begin
|
80
|
+
res = ec2_client.send(
|
81
|
+
method_name,
|
82
|
+
{ filters: [{ name: "#{type}-gateway-id", values: [gateway_id] }] }
|
83
|
+
)
|
84
|
+
resource = res["#{type}_gateways"].single_resource(gateway_id)
|
85
|
+
return resource if resource
|
86
|
+
rescue StandardError
|
87
|
+
resource = nil
|
88
|
+
end
|
85
89
|
|
86
90
|
res = ec2_client.send(
|
87
91
|
method_name,
|
@@ -14,12 +14,12 @@ module Awspec::Helper
|
|
14
14
|
res = ec2_client.describe_addresses({
|
15
15
|
filters: [{ name: 'public-ip', values: [id] }]
|
16
16
|
})
|
17
|
-
return res.addresses unless res.addresses.empty?
|
17
|
+
return res.addresses.single_resource(id) unless res.addresses.empty?
|
18
18
|
|
19
19
|
res = ec2_client.describe_addresses({
|
20
20
|
filters: [{ name: 'tag:Name', values: [id] }]
|
21
21
|
})
|
22
|
-
res.addresses
|
22
|
+
res.addresses.single_resource(id)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -7,7 +7,20 @@ Aws.config[:ec2] = {
|
|
7
7
|
vpn_gateway_id: 'vgw-cg5692g4',
|
8
8
|
availability_zone: 'us-east-1a',
|
9
9
|
state: 'available',
|
10
|
-
type: "ipsec.1"
|
10
|
+
type: "ipsec.1",
|
11
|
+
vpc_attachments: [
|
12
|
+
{
|
13
|
+
state: 'attached',
|
14
|
+
vpc_id: 'vpc-ab123cde'
|
15
|
+
}
|
16
|
+
],
|
17
|
+
amazon_side_asn: 64512,
|
18
|
+
tags: [
|
19
|
+
{
|
20
|
+
key: 'Name',
|
21
|
+
value: 'my-vpn-gateway'
|
22
|
+
}
|
23
|
+
]
|
11
24
|
}
|
12
25
|
]
|
13
26
|
}
|
data/lib/awspec/type/eip.rb
CHANGED
@@ -2,18 +2,20 @@
|
|
2
2
|
|
3
3
|
module Awspec::Type
|
4
4
|
class Eip < ResourceBase
|
5
|
+
aws_resource Aws::EC2::Types::Address
|
6
|
+
|
5
7
|
def resource_via_client
|
6
8
|
@resource_via_client ||= select_eip(@display_name)
|
7
9
|
end
|
8
10
|
|
9
11
|
def id
|
10
|
-
@id ||= resource_via_client.
|
12
|
+
@id ||= resource_via_client.public_ip if resource_via_client
|
11
13
|
end
|
12
14
|
|
13
15
|
def associated_to?(instance_id)
|
14
|
-
return false unless resource_via_client.
|
16
|
+
return false unless resource_via_client.instance_id == instance_id
|
15
17
|
|
16
|
-
resource_via_client.
|
18
|
+
resource_via_client.instance_id == instance_id
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
@@ -27,16 +27,8 @@ module Awspec::Type
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
31
|
-
resource_via_client.
|
32
|
-
end
|
33
|
-
|
34
|
-
def vpc_attachments
|
35
|
-
resource_via_client.vpc_attachments
|
36
|
-
end
|
37
|
-
|
38
|
-
def type
|
39
|
-
resource_via_client.type
|
30
|
+
def vpc_id
|
31
|
+
resource_via_client.vpc_attachments.first.vpc_id
|
40
32
|
end
|
41
33
|
end
|
42
34
|
end
|
data/lib/awspec/version.rb
CHANGED
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.28.
|
4
|
+
version: 1.28.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|