cloudster 2.9.0 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/VERSION +1 -1
- data/cloudster.gemspec +2 -2
- data/lib/cloudster/rds.rb +12 -4
- data/spec/cloud_spec.rb +2 -1
- data/spec/rds_spec.rb +5 -3
- metadata +3 -3
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.10.0
|
data/cloudster.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "cloudster"
|
8
|
-
s.version = "2.
|
8
|
+
s.version = "2.10.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Emil Soman"]
|
12
|
-
s.date = "2012-11-
|
12
|
+
s.date = "2012-11-22"
|
13
13
|
s.description = "Cloudster is a Ruby gem that was born to cut the learning curve involved \n in writing your own CloudFormation templates. If you don't know what a CloudFormation template is, \n but know about the AWS Cloud offerings, you can still use cloudster to provision your stack. \n Still in infancy , cloudster can create a very basic stack like a breeze. All kinds of contribution welcome !"
|
14
14
|
s.email = "emil.soman@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/cloudster/rds.rb
CHANGED
@@ -14,7 +14,8 @@ module Cloudster
|
|
14
14
|
# :storage_class => '100',
|
15
15
|
# :username => 'admin',
|
16
16
|
# :password => 'admin123',
|
17
|
-
# :engine => 'MySQL'
|
17
|
+
# :engine => 'MySQL',
|
18
|
+
# :multi_az => true
|
18
19
|
# )
|
19
20
|
#
|
20
21
|
# ==== Parameters
|
@@ -27,18 +28,21 @@ module Cloudster
|
|
27
28
|
# * :password: String containing the master password for the DB instance. Default: 'root'
|
28
29
|
# * :engine: String containing the name of the database engine to be used for this DB instance. Default: 'MySQL'
|
29
30
|
# Valid values : MySQL | oracle-se1 | oracle-se | oracle-ee | sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web
|
31
|
+
# * :multi_az: Boolean to maintain a standby in a different Availability Zone for automatic failover in the event of a scheduled or unplanned outage
|
30
32
|
def initialize(options = {})
|
31
33
|
require_options(options, [:name, :storage_size])
|
32
34
|
options[:username] ||= 'root'
|
33
35
|
options[:password] ||= 'root'
|
34
36
|
options[:engine] ||= 'MySQL'
|
35
37
|
options[:instance_class] ||= 'db.t1.micro'
|
38
|
+
options[:multi_az] ||= false
|
36
39
|
@name = options[:name]
|
37
40
|
@storage_size = options[:storage_size]
|
38
41
|
@username = options[:username]
|
39
42
|
@password = options[:password]
|
40
43
|
@engine = options[:engine]
|
41
44
|
@instance_class = options[:instance_class]
|
45
|
+
@multi_az = options[:multi_az]
|
42
46
|
end
|
43
47
|
|
44
48
|
# Returns a Ruby hash version of the Cloud Formation template for the resource instance
|
@@ -50,14 +54,15 @@ module Cloudster
|
|
50
54
|
# :storage_class => '100',
|
51
55
|
# :username => 'admin',
|
52
56
|
# :password => 'admin123',
|
53
|
-
# :engine => 'MySQL'
|
57
|
+
# :engine => 'MySQL',
|
58
|
+
# :multi_az => true
|
54
59
|
# )
|
55
60
|
# rds.template
|
56
61
|
#
|
57
62
|
# ==== Returns
|
58
63
|
# * Ruby hash version of the Cloud Formation template for the resource instance
|
59
64
|
def template
|
60
|
-
Rds.template({:name =>@name, :instance_class => @instance_class, :storage_size => @storage_size, :username => @username, :password => @password, :engine => @engine})
|
65
|
+
Rds.template({:name =>@name, :instance_class => @instance_class, :storage_size => @storage_size, :username => @username, :password => @password, :engine => @engine, :multi_az => @multi_az})
|
61
66
|
end
|
62
67
|
|
63
68
|
# Class method that returns a Ruby hash version of the Cloud Formation template
|
@@ -85,6 +90,7 @@ module Cloudster
|
|
85
90
|
# * :password: String containing the master password for the DB instance. Default: 'root'
|
86
91
|
# * :engine: String containing the name of the database engine to be used for this DB instance. Default: 'MySQL'
|
87
92
|
# Valid values : MySQL | oracle-se1 | oracle-se | oracle-ee | sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web
|
93
|
+
# * :multi_az: Boolean to maintain a standby in a different Availability Zone for automatic failover in the event of a scheduled or unplanned outage
|
88
94
|
#
|
89
95
|
# ==== Returns
|
90
96
|
# * Ruby hash version of the Cloud Formation template
|
@@ -94,6 +100,7 @@ module Cloudster
|
|
94
100
|
options[:password] ||= 'root'
|
95
101
|
options[:engine] ||= 'MySQL'
|
96
102
|
options[:instance_class] ||= 'db.t1.micro'
|
103
|
+
options[:multi_az] ||= false
|
97
104
|
template = {'Resources' => {
|
98
105
|
options[:name] => {
|
99
106
|
"Type" => "AWS::RDS::DBInstance",
|
@@ -102,7 +109,8 @@ module Cloudster
|
|
102
109
|
"MasterUsername" => options[:username],
|
103
110
|
"MasterUserPassword" => options[:password],
|
104
111
|
"DBInstanceClass" => options[:instance_class],
|
105
|
-
"AllocatedStorage" => options[:storage_size]
|
112
|
+
"AllocatedStorage" => options[:storage_size],
|
113
|
+
"MultiAZ" => options[:multi_az]
|
106
114
|
}
|
107
115
|
}
|
108
116
|
}
|
data/spec/cloud_spec.rb
CHANGED
data/spec/rds_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Cloudster::Rds do
|
|
11
11
|
end
|
12
12
|
describe '#template' do
|
13
13
|
it "should return a ruby hash for the resource cloudformation template" do
|
14
|
-
rds = Cloudster::Rds.new(:name => 'MySqlDB', :storage_size => '10')
|
14
|
+
rds = Cloudster::Rds.new(:name => 'MySqlDB', :storage_size => '10', :multi_az => true)
|
15
15
|
template = {'Resources' => {
|
16
16
|
'MySqlDB' => {
|
17
17
|
"Type" => "AWS::RDS::DBInstance",
|
@@ -20,7 +20,8 @@ describe Cloudster::Rds do
|
|
20
20
|
"MasterUsername" => 'root',
|
21
21
|
"MasterUserPassword" => 'root',
|
22
22
|
"DBInstanceClass" => 'db.t1.micro',
|
23
|
-
"AllocatedStorage" => '10'
|
23
|
+
"AllocatedStorage" => '10',
|
24
|
+
"MultiAZ" => true
|
24
25
|
}
|
25
26
|
}
|
26
27
|
}
|
@@ -42,7 +43,8 @@ describe Cloudster::Rds do
|
|
42
43
|
"MasterUsername" => 'root',
|
43
44
|
"MasterUserPassword" => 'root',
|
44
45
|
"DBInstanceClass" => 'db.t1.micro',
|
45
|
-
"AllocatedStorage" => '10'
|
46
|
+
"AllocatedStorage" => '10',
|
47
|
+
"MultiAZ" => false
|
46
48
|
}
|
47
49
|
}
|
48
50
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
@@ -158,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
segments:
|
160
160
|
- 0
|
161
|
-
hash:
|
161
|
+
hash: 929236787
|
162
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
163
|
none: false
|
164
164
|
requirements:
|