awspec 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/type/ec2.rb +5 -14
- data/lib/awspec/type/rds.rb +5 -16
- data/lib/awspec/type/rds_db_parameter_group.rb +31 -0
- data/lib/awspec/type/security_group.rb +5 -7
- data/lib/awspec/type/vpc.rb +5 -7
- data/lib/awspec/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c81642a5b9b297d827bead3be1bf63946948cf8
|
4
|
+
data.tar.gz: ec37738f21f3047036e55876a6386406edd33220
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af5ebabeece857dbf0eeb260b5541ef925448ddab272f382c74cd1234f0e3097062620ef3bac6bf71879f2f72e36e0a3fe80e3fb644193e4074b183daeb2965
|
7
|
+
data.tar.gz: 6011008a79a69fe3f8fd2184374ee03670f27e550d1162e5b4f64cd1f55f124ed9c0bb1ea657c623e30129d877d6c6f0737d3f18f7630a25b892bc8802f5f7da
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# awspec [![
|
1
|
+
# awspec [![Gem](https://img.shields.io/gem/v/awspec.svg)](https://rubygems.org/gems/awspec) [![Travis](https://img.shields.io/travis/k1LoW/awspec.svg)](https://travis-ci.org/k1LoW/awspec)
|
2
2
|
|
3
3
|
RSpec tests for your AWS resources.
|
4
4
|
|
@@ -41,11 +41,11 @@ end
|
|
41
41
|
|
42
42
|
## Support AWS Resources
|
43
43
|
|
44
|
-
- [X] EC2
|
45
|
-
- [X] RDS
|
46
|
-
- [
|
47
|
-
- [X] Security Group
|
48
|
-
- [X] VPC
|
44
|
+
- [X] EC2 (`ec2`)
|
45
|
+
- [X] RDS (`rds`)
|
46
|
+
- [X] RDS DB Parameter Group (`rds_db_parameter_group`)
|
47
|
+
- [X] Security Group (`security_group`)
|
48
|
+
- [X] VPC (`vpc`)
|
49
49
|
|
50
50
|
### Next..
|
51
51
|
|
data/lib/awspec/helper/type.rb
CHANGED
data/lib/awspec/type/ec2.rb
CHANGED
@@ -48,21 +48,12 @@ module Awspec::Type
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
instance_type launch_time placement kernel_id ramdisk_id platform
|
55
|
-
monitoring subnet_id vpc_id private_ip_address public_ip_address
|
56
|
-
state_reason architecture root_device_type root_device_name
|
57
|
-
block_device_mappings virtualization_type instance_lifecycle
|
58
|
-
spot_instance_request_id client_token tags security_groups
|
59
|
-
source_dest_check hypervisor network_interfaces
|
60
|
-
iam_instance_profile ebs_optimized sriov_net_support
|
61
|
-
)
|
62
|
-
|
63
|
-
describes.each do |describe|
|
64
|
-
define_method describe do
|
51
|
+
def method_missing(name)
|
52
|
+
describe = name.to_s
|
53
|
+
if @instance.key?(describe)
|
65
54
|
@instance[describe]
|
55
|
+
else
|
56
|
+
super
|
66
57
|
end
|
67
58
|
end
|
68
59
|
|
data/lib/awspec/type/rds.rb
CHANGED
@@ -29,23 +29,12 @@ module Awspec::Type
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
preferred_backup_window backup_retention_period db_security_groups
|
36
|
-
vpc_security_groups db_parameter_groups availability_zone
|
37
|
-
db_subnet_group preferred_maintenance_window pending_modified_values
|
38
|
-
latest_restorable_time multi_az engine_version auto_minor_version_upgrade
|
39
|
-
read_replica_source_db_instance_identifier
|
40
|
-
read_replica_db_instance_identifiers license_model iops
|
41
|
-
option_group_memberships character_set_name secondary_availability_zone
|
42
|
-
publicly_accessible status_infos storage_type tde_credential_arn
|
43
|
-
storage_encrypted kms_key_id dbi_resource_id ca_certificate_identifier
|
44
|
-
)
|
45
|
-
|
46
|
-
describes.each do |describe|
|
47
|
-
define_method describe do
|
32
|
+
def method_missing(name)
|
33
|
+
describe = name.to_s
|
34
|
+
if @instance.key?(describe)
|
48
35
|
@instance[describe]
|
36
|
+
else
|
37
|
+
super
|
49
38
|
end
|
50
39
|
end
|
51
40
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class RdsDbParameterGroup < Base
|
3
|
+
attr_reader :parameters
|
4
|
+
|
5
|
+
def initialize(name)
|
6
|
+
@client = Aws::RDS::Client.new
|
7
|
+
@parameters = {}
|
8
|
+
|
9
|
+
marker = nil
|
10
|
+
while @parameters.empty? || !marker.nil?
|
11
|
+
res = @client.describe_db_parameters(
|
12
|
+
db_parameter_group_name: name,
|
13
|
+
marker: marker)
|
14
|
+
marker = res.marker
|
15
|
+
break if res.parameters.empty?
|
16
|
+
res.parameters.each do |param|
|
17
|
+
@parameters[param.parameter_name] = param.parameter_value
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def method_missing(name)
|
23
|
+
param_name = name.to_s
|
24
|
+
if @parameters.key?(param_name)
|
25
|
+
@parameters[param_name].to_s
|
26
|
+
else
|
27
|
+
super
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -10,14 +10,12 @@ module Awspec::Type
|
|
10
10
|
@id = @sg[:group_id]
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
|
18
|
-
describes.each do |describe|
|
19
|
-
define_method describe do
|
13
|
+
def method_missing(name)
|
14
|
+
describe = name.to_s
|
15
|
+
if @sg.key?(describe)
|
20
16
|
@sg[describe]
|
17
|
+
else
|
18
|
+
super
|
21
19
|
end
|
22
20
|
end
|
23
21
|
|
data/lib/awspec/type/vpc.rb
CHANGED
@@ -19,14 +19,12 @@ module Awspec::Type
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
)
|
26
|
-
|
27
|
-
describes.each do |describe|
|
28
|
-
define_method describe do
|
22
|
+
def method_missing(name)
|
23
|
+
describe = name.to_s
|
24
|
+
if @vpc.key?(describe)
|
29
25
|
@vpc[describe]
|
26
|
+
else
|
27
|
+
super
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
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: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- lib/awspec/type/base.rb
|
140
140
|
- lib/awspec/type/ec2.rb
|
141
141
|
- lib/awspec/type/rds.rb
|
142
|
+
- lib/awspec/type/rds_db_parameter_group.rb
|
142
143
|
- lib/awspec/type/security_group.rb
|
143
144
|
- lib/awspec/type/vpc.rb
|
144
145
|
- lib/awspec/version.rb
|