cucloud 0.7.2 → 0.7.3
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/lib/cucloud/rds_utils.rb +28 -1
- data/lib/cucloud/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fab450ec90ef357ac90e8c9ba62c46b02431043e
|
4
|
+
data.tar.gz: 26be30069b2694d5c80333eeedadb836a00e2c08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eba5db27ae7096b13b6ccb594cd610b56b442989a29cc47f0f64cbb982a80364296facf4949fcb33a77c8a4a47f479d17edf7e355f3b4f76f008820f0953c97
|
7
|
+
data.tar.gz: 70f4748edd83f96dbd8d0675a9e3e75e25ff1fcd09e09ba8246fb8160268a94af8fdb0ce314357f313b597de7e7c7aafe7f604eaf1e692df0c64a84bb64e7166
|
data/lib/cucloud/rds_utils.rb
CHANGED
@@ -24,7 +24,7 @@ module Cucloud
|
|
24
24
|
def does_db_exist?(db_instance_identifier)
|
25
25
|
get_instance(db_instance_identifier).instance_create_time
|
26
26
|
true
|
27
|
-
rescue
|
27
|
+
rescue
|
28
28
|
false
|
29
29
|
end
|
30
30
|
|
@@ -46,6 +46,32 @@ module Cucloud
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
# Modify the security groups for a RDS instance
|
50
|
+
# @param db_instance_identifier [String] RDS instance identifier
|
51
|
+
# @param vpc_security_group_ids [Array] Array of security groups to apply
|
52
|
+
# @return [Hash] Hash represnting the return from AWS
|
53
|
+
def modify_security_group(db_instance_identifier, vpc_security_groups)
|
54
|
+
modify_db_instance(db_instance_identifier: db_instance_identifier, vpc_security_group_ids: vpc_security_groups)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Modify the options group for a RDS instance
|
58
|
+
# @param db_instance_identifier [String] RDS instance identifier
|
59
|
+
# @param option_group_name [Sting] Name od the options group to apply
|
60
|
+
# @return [Hash] Hash represnting the return from AWS
|
61
|
+
def modify_option_group(db_instance_identifier, option_group_name)
|
62
|
+
modify_db_instance(db_instance_identifier: db_instance_identifier, option_group_name: option_group_name)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Base function to modify DB, resets defualts for apply_immediately and copy_tags_to_snapshot
|
66
|
+
# @param options [hash] Hash represnting the configuration for the RDS restore
|
67
|
+
# @return [Hash] Hash represnting the return from AWS
|
68
|
+
def modify_db_instance(options)
|
69
|
+
options[:apply_immediately] = options[:apply_immediately].nil? ? true : options[:apply_immediately]
|
70
|
+
options[:copy_tags_to_snapshot] = options[:copy_tags_to_snapshot].nil? ? true : options[:copy_tags_to_snapshot]
|
71
|
+
|
72
|
+
@rds.modify_db_instance(options)
|
73
|
+
end
|
74
|
+
|
49
75
|
# Restore DB from a snapshot
|
50
76
|
# @param db_instance_identifier [String] RDS instance identifier
|
51
77
|
# @param db_snapshot_identifier [String] Name for final snapshot, default is nil
|
@@ -57,6 +83,7 @@ module Cucloud
|
|
57
83
|
options[:db_instance_identifier] = db_instance_identifier
|
58
84
|
options[:db_snapshot_identifier] = db_snapshot_identifier
|
59
85
|
@rds.restore_db_instance_from_db_snapshot(options)
|
86
|
+
@rds.wait_until(:db_instance_deleted, db_instance_identifier: db_instance_identifier)
|
60
87
|
end
|
61
88
|
|
62
89
|
# Delete a givne db instance
|
data/lib/cucloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sbower
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-03-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws-sdk
|