awspec 1.4.3 → 1.5.0
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/rds.md +8 -0
- data/doc/resource_types.md +8 -0
- data/lib/awspec/matcher.rb +2 -0
- data/lib/awspec/matcher/have_db_parameter_group.rb +9 -0
- data/lib/awspec/matcher/have_option_group.rb +9 -0
- data/lib/awspec/stub/rds.rb +8 -4
- data/lib/awspec/type/rds.rb +13 -4
- data/lib/awspec/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aaeb6e4dc658f764f20bec8fdac89d45a084797
|
4
|
+
data.tar.gz: e02bd3450a6008edef4b22b79a66cd798a8a0f1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9778ec751b40035b38ed973b86aad9efeedb766da6e002bf1bcafbd7b5afb43e4094ce361c79acf25c0a231c00d7de440f7463adb26a277362ca5d51ae8901d
|
7
|
+
data.tar.gz: c4b2e854c8bf2f6e954496030332bbb8a19c8ba671c5702f42054b1cea85041692d56ce757410f7f975fb8f3defdd8a8e829c994f0a36e770a96677e92439472
|
data/doc/_resource_types/rds.md
CHANGED
@@ -19,6 +19,10 @@ end
|
|
19
19
|
```ruby
|
20
20
|
describe rds('my-rds') do
|
21
21
|
it { should have_db_parameter_group('my-db-parameter-group') }
|
22
|
+
it do
|
23
|
+
should have_db_parameter_group('custom.mysql5.6')\
|
24
|
+
.parameter_apply_status('in-sync')
|
25
|
+
end
|
22
26
|
end
|
23
27
|
```
|
24
28
|
|
@@ -27,6 +31,10 @@ end
|
|
27
31
|
```ruby
|
28
32
|
describe rds('my-rds') do
|
29
33
|
it { should have_option_group('default:mysql-5-6') }
|
34
|
+
it do
|
35
|
+
should have_option_group('default:mysql-5-6')\
|
36
|
+
.status('in-sync')
|
37
|
+
end
|
30
38
|
end
|
31
39
|
```
|
32
40
|
|
data/doc/resource_types.md
CHANGED
@@ -2083,6 +2083,10 @@ end
|
|
2083
2083
|
```ruby
|
2084
2084
|
describe rds('my-rds') do
|
2085
2085
|
it { should have_db_parameter_group('my-db-parameter-group') }
|
2086
|
+
it do
|
2087
|
+
should have_db_parameter_group('custom.mysql5.6')\
|
2088
|
+
.parameter_apply_status('in-sync')
|
2089
|
+
end
|
2086
2090
|
end
|
2087
2091
|
```
|
2088
2092
|
|
@@ -2092,6 +2096,10 @@ end
|
|
2092
2096
|
```ruby
|
2093
2097
|
describe rds('my-rds') do
|
2094
2098
|
it { should have_option_group('default:mysql-5-6') }
|
2099
|
+
it do
|
2100
|
+
should have_option_group('default:mysql-5-6')\
|
2101
|
+
.status('in-sync')
|
2102
|
+
end
|
2095
2103
|
end
|
2096
2104
|
```
|
2097
2105
|
|
data/lib/awspec/matcher.rb
CHANGED
@@ -6,6 +6,8 @@ require 'awspec/matcher/have_network_interface'
|
|
6
6
|
|
7
7
|
# RDS
|
8
8
|
require 'awspec/matcher/belong_to_db_subnet_group'
|
9
|
+
require 'awspec/matcher/have_db_parameter_group'
|
10
|
+
require 'awspec/matcher/have_option_group'
|
9
11
|
|
10
12
|
# SecurityGroup
|
11
13
|
require 'awspec/matcher/be_opened'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
RSpec::Matchers.define :have_db_parameter_group do |name|
|
2
|
+
match do |db_instance_identifier|
|
3
|
+
db_instance_identifier.has_db_parameter_group?(name, @parameter_apply_status)
|
4
|
+
end
|
5
|
+
|
6
|
+
chain :parameter_apply_status do |parameter_apply_status|
|
7
|
+
@parameter_apply_status = parameter_apply_status
|
8
|
+
end
|
9
|
+
end
|
data/lib/awspec/stub/rds.rb
CHANGED
@@ -34,18 +34,22 @@ Aws.config[:rds] = {
|
|
34
34
|
},
|
35
35
|
db_parameter_groups: [
|
36
36
|
{
|
37
|
-
db_parameter_group_name: 'default.mysql5.6'
|
37
|
+
db_parameter_group_name: 'default.mysql5.6',
|
38
|
+
parameter_apply_status: 'pending-reboot'
|
38
39
|
},
|
39
40
|
{
|
40
|
-
db_parameter_group_name: 'custom.mysql5.6'
|
41
|
+
db_parameter_group_name: 'custom.mysql5.6',
|
42
|
+
parameter_apply_status: 'in-sync'
|
41
43
|
}
|
42
44
|
],
|
43
45
|
option_group_memberships: [
|
44
46
|
{
|
45
|
-
option_group_name: 'default:mysql-5-6'
|
47
|
+
option_group_name: 'default:mysql-5-6',
|
48
|
+
status: 'in-sync'
|
46
49
|
},
|
47
50
|
{
|
48
|
-
option_group_name: 'custom:mysql-5-6'
|
51
|
+
option_group_name: 'custom:mysql-5-6',
|
52
|
+
status: 'in-sync'
|
49
53
|
}
|
50
54
|
],
|
51
55
|
availability_zone: 'ap-northeast-1a',
|
data/lib/awspec/type/rds.rb
CHANGED
@@ -37,17 +37,26 @@ module Awspec::Type
|
|
37
37
|
return true if has_db_security_group_name?(sg_id)
|
38
38
|
end
|
39
39
|
|
40
|
-
def has_db_parameter_group?(name)
|
40
|
+
def has_db_parameter_group?(name, parameter_apply_status = nil)
|
41
41
|
pgs = resource_via_client.db_parameter_groups
|
42
42
|
pgs.find do |pg|
|
43
|
-
|
43
|
+
if parameter_apply_status.nil?
|
44
|
+
pg.db_parameter_group_name == name
|
45
|
+
else
|
46
|
+
pg.db_parameter_group_name == name && \
|
47
|
+
pg.parameter_apply_status == parameter_apply_status
|
48
|
+
end
|
44
49
|
end
|
45
50
|
end
|
46
51
|
|
47
|
-
def has_option_group?(name)
|
52
|
+
def has_option_group?(name, status = nil)
|
48
53
|
ogs = resource_via_client.option_group_memberships
|
49
54
|
ogs.find do |og|
|
50
|
-
|
55
|
+
if status.nil?
|
56
|
+
og.option_group_name == name
|
57
|
+
else
|
58
|
+
og.option_group_name == name && og.status == status
|
59
|
+
end
|
51
60
|
end
|
52
61
|
end
|
53
62
|
|
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.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -445,10 +445,12 @@ files:
|
|
445
445
|
- lib/awspec/matcher/belong_to_vpc.rb
|
446
446
|
- lib/awspec/matcher/have_attribute_definition.rb
|
447
447
|
- lib/awspec/matcher/have_custom_response_error_code.rb
|
448
|
+
- lib/awspec/matcher/have_db_parameter_group.rb
|
448
449
|
- lib/awspec/matcher/have_inline_policy.rb
|
449
450
|
- lib/awspec/matcher/have_key_policy.rb
|
450
451
|
- lib/awspec/matcher/have_key_schema.rb
|
451
452
|
- lib/awspec/matcher/have_network_interface.rb
|
453
|
+
- lib/awspec/matcher/have_option_group.rb
|
452
454
|
- lib/awspec/matcher/have_origin.rb
|
453
455
|
- lib/awspec/matcher/have_private_ip_address.rb
|
454
456
|
- lib/awspec/matcher/have_record_set.rb
|