cloudster 2.13.0 → 2.13.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +28 -5
- data/README.md +3 -3
- data/VERSION +1 -1
- data/cloudster.gemspec +2 -2
- data/lib/cloudster/cloud.rb +38 -23
- data/lib/cloudster/ec2.rb +5 -5
- metadata +3 -3
data/Gemfile.lock
CHANGED
@@ -4,7 +4,9 @@ GEM
|
|
4
4
|
builder (3.1.4)
|
5
5
|
diff-lcs (1.1.3)
|
6
6
|
excon (0.16.10)
|
7
|
-
|
7
|
+
faraday (0.8.4)
|
8
|
+
multipart-post (~> 1.1)
|
9
|
+
fog (1.8.0)
|
8
10
|
builder
|
9
11
|
excon (~> 0.14)
|
10
12
|
formatador (~> 0.2.0)
|
@@ -16,27 +18,48 @@ GEM
|
|
16
18
|
ruby-hmac
|
17
19
|
formatador (0.2.4)
|
18
20
|
git (1.2.5)
|
21
|
+
github_api (0.8.1)
|
22
|
+
faraday (~> 0.8.1)
|
23
|
+
hashie (~> 1.2.0)
|
24
|
+
multi_json (~> 1.3)
|
25
|
+
nokogiri (~> 1.5.2)
|
26
|
+
oauth2
|
27
|
+
hashie (1.2.0)
|
28
|
+
highline (1.6.15)
|
29
|
+
httpauth (0.2.0)
|
19
30
|
jeweler (1.8.4)
|
20
31
|
bundler (~> 1.0)
|
21
32
|
git (>= 1.2.5)
|
33
|
+
github_api (>= 0.8.1)
|
34
|
+
highline (>= 1.6.15)
|
22
35
|
rake
|
23
36
|
rdoc
|
24
37
|
json (1.7.5)
|
38
|
+
jwt (0.1.5)
|
39
|
+
multi_json (>= 1.0)
|
25
40
|
mime-types (1.19)
|
26
|
-
multi_json (1.
|
41
|
+
multi_json (1.5.0)
|
42
|
+
multipart-post (1.1.5)
|
27
43
|
net-scp (1.0.4)
|
28
44
|
net-ssh (>= 1.99.1)
|
29
45
|
net-ssh (2.6.2)
|
30
46
|
nokogiri (1.5.5)
|
31
|
-
|
47
|
+
oauth2 (0.8.0)
|
48
|
+
faraday (~> 0.8)
|
49
|
+
httpauth (~> 0.1)
|
50
|
+
jwt (~> 0.1.4)
|
51
|
+
multi_json (~> 1.0)
|
52
|
+
rack (~> 1.2)
|
53
|
+
rack (1.4.1)
|
54
|
+
rake (10.0.3)
|
32
55
|
rdoc (3.12)
|
33
56
|
json (~> 1.4)
|
34
57
|
rspec (2.12.0)
|
35
58
|
rspec-core (~> 2.12.0)
|
36
59
|
rspec-expectations (~> 2.12.0)
|
37
60
|
rspec-mocks (~> 2.12.0)
|
38
|
-
rspec-core (2.12.
|
39
|
-
rspec-expectations (2.12.
|
61
|
+
rspec-core (2.12.2)
|
62
|
+
rspec-expectations (2.12.1)
|
40
63
|
diff-lcs (~> 1.1.3)
|
41
64
|
rspec-mocks (2.12.0)
|
42
65
|
ruby-hmac (0.4.0)
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Cloudster [![Build Status](https://travis-ci.org/emilsoman/cloudster.png)](https://travis-ci.org/emilsoman/cloudster) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/emilsoman/cloudster) [![Dependency Status](https://gemnasium.com/emilsoman/cloudster.png)](https://gemnasium.com/emilsoman/cloudster)
|
2
2
|
|
3
|
-
Cloudster is a Ruby gem that was born to cut the learning curve involved in writing your own CloudFormation templates. If you don't know what
|
4
|
-
a CloudFormation template is, but know about the AWS Cloud offerings, you can still use cloudster to provision your stack. Still in infancy , cloudster
|
3
|
+
Cloudster is a Ruby gem that was born to cut the learning curve involved in writing your own CloudFormation templates. If you don't know what
|
4
|
+
a CloudFormation template is, but know about the AWS Cloud offerings, you can still use cloudster to provision your stack. Still in infancy , cloudster
|
5
5
|
can create a very basic stack like a breeze. All kinds of contribution welcome !
|
6
6
|
|
7
7
|
##Installation
|
@@ -132,7 +132,7 @@ helpful.
|
|
132
132
|
|
133
133
|
## Need help?
|
134
134
|
|
135
|
-
You can use the [Issues](https://github.com/emilsoman/cloudster/issues) page to ask a new question. This is how you do it:
|
135
|
+
You can use the [Issues](https://github.com/emilsoman/cloudster/issues) page to ask a new question. This is how you do it:
|
136
136
|
1. Click on New Issue
|
137
137
|
2. Type in your question
|
138
138
|
3. Add a "question" label to the issue
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.13.
|
1
|
+
2.13.1
|
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.13.
|
8
|
+
s.version = "2.13.1"
|
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-12-
|
12
|
+
s.date = "2012-12-18"
|
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/cloud.rb
CHANGED
@@ -17,8 +17,9 @@ module Cloudster
|
|
17
17
|
#
|
18
18
|
# ==== Examples
|
19
19
|
# cloud = Cloudster::Cloud.new(
|
20
|
-
# :access_key_id => 'aws_access_key_id'
|
20
|
+
# :access_key_id => 'aws_access_key_id',
|
21
21
|
# :secret_access_key => 'aws_secret_access_key',
|
22
|
+
# :region => 'us-east-1'
|
22
23
|
# )
|
23
24
|
def initialize(options = {})
|
24
25
|
require_options(options, [:access_key_id, :secret_access_key])
|
@@ -36,8 +37,9 @@ module Cloudster
|
|
36
37
|
#
|
37
38
|
# ==== Examples
|
38
39
|
# cloud = Cloudster::Cloud.new(
|
39
|
-
# :access_key_id => 'aws_access_key_id'
|
40
|
+
# :access_key_id => 'aws_access_key_id',
|
40
41
|
# :secret_access_key => 'aws_secret_access_key',
|
42
|
+
# :region => 'us-east-1'
|
41
43
|
# )
|
42
44
|
#
|
43
45
|
# cloud.template(:resources => [<AWS RESOURCES ARRAY>], :description => 'This is the description for the stack template')
|
@@ -46,12 +48,12 @@ module Cloudster
|
|
46
48
|
# options parameter must include values for :resources
|
47
49
|
#
|
48
50
|
# ==== Parameters
|
49
|
-
# * options<~Hash> -
|
51
|
+
# * options<~Hash> -
|
50
52
|
# * :resources : An array of Cloudster resource instances. Defaults to {}.
|
51
53
|
# * :description : A string which will be used as the Description of the CloudFormation template.
|
52
54
|
#
|
53
55
|
# ==== Returns
|
54
|
-
# * JSON cloud formation template
|
56
|
+
# * JSON cloud formation template
|
55
57
|
def template(options = {})
|
56
58
|
require_options(options, [:resources])
|
57
59
|
resources = options[:resources]
|
@@ -72,8 +74,9 @@ module Cloudster
|
|
72
74
|
#
|
73
75
|
# ==== Examples
|
74
76
|
# cloud = Cloudster::Cloud.new(
|
75
|
-
# :access_key_id => 'aws_access_key_id'
|
77
|
+
# :access_key_id => 'aws_access_key_id',
|
76
78
|
# :secret_access_key => 'aws_secret_access_key',
|
79
|
+
# :region => 'us-east-1'
|
77
80
|
# )
|
78
81
|
#
|
79
82
|
# cloud.provision(:resources => [<AWS RESOURCES ARRRAY>],
|
@@ -103,8 +106,9 @@ module Cloudster
|
|
103
106
|
#
|
104
107
|
# ==== Examples
|
105
108
|
# cloud = Cloudster::Cloud.new(
|
106
|
-
# :access_key_id => 'aws_access_key_id'
|
109
|
+
# :access_key_id => 'aws_access_key_id',
|
107
110
|
# :secret_access_key => 'aws_secret_access_key',
|
111
|
+
# :region => 'us-east-1'
|
108
112
|
# )
|
109
113
|
#
|
110
114
|
# cloud.update(:resources => [<AWS RESOURCES ARRRAY>],
|
@@ -134,8 +138,9 @@ module Cloudster
|
|
134
138
|
#
|
135
139
|
# ==== Examples
|
136
140
|
# cloud = Cloudster::Cloud.new(
|
137
|
-
# :access_key_id => 'aws_access_key_id'
|
141
|
+
# :access_key_id => 'aws_access_key_id',
|
138
142
|
# :secret_access_key => 'aws_secret_access_key',
|
143
|
+
# :region => 'us-east-1'
|
139
144
|
# )
|
140
145
|
# cloud.events(:stack_name => 'ShittyStack')
|
141
146
|
#
|
@@ -154,8 +159,9 @@ module Cloudster
|
|
154
159
|
#
|
155
160
|
# ==== Examples
|
156
161
|
# cloud = Cloudster::Cloud.new(
|
157
|
-
# :access_key_id => 'aws_access_key_id'
|
162
|
+
# :access_key_id => 'aws_access_key_id',
|
158
163
|
# :secret_access_key => 'aws_secret_access_key',
|
164
|
+
# :region => 'us-east-1'
|
159
165
|
# )
|
160
166
|
# cloud.delete(:stack_name => 'ShittyStack')
|
161
167
|
#
|
@@ -175,8 +181,9 @@ module Cloudster
|
|
175
181
|
#
|
176
182
|
# ==== Examples
|
177
183
|
# cloud = Cloudster::Cloud.new(
|
178
|
-
# :access_key_id => 'aws_access_key_id'
|
184
|
+
# :access_key_id => 'aws_access_key_id',
|
179
185
|
# :secret_access_key => 'aws_secret_access_key',
|
186
|
+
# :region => 'us-east-1'
|
180
187
|
# )
|
181
188
|
# cloud.get_database_endpoints(:stack_name => 'ShittyStack')
|
182
189
|
#
|
@@ -189,7 +196,7 @@ module Cloudster
|
|
189
196
|
def get_database_endpoints(options = {})
|
190
197
|
rds_physical_ids = get_resource_ids(resources(options), "AWS::RDS::DBInstance").values
|
191
198
|
return [] if rds_physical_ids.empty?
|
192
|
-
rds = Fog::AWS::RDS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key)
|
199
|
+
rds = Fog::AWS::RDS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key, :region => @region)
|
193
200
|
endpoints = []
|
194
201
|
rds_physical_ids.each do |rds_physical_id|
|
195
202
|
endpoint = rds.describe_db_instances(rds_physical_id).body["DescribeDBInstancesResult"]["DBInstances"][0]["Endpoint"] rescue nil
|
@@ -202,8 +209,9 @@ module Cloudster
|
|
202
209
|
#
|
203
210
|
# ==== Examples
|
204
211
|
# cloud = Cloudster::Cloud.new(
|
205
|
-
# :access_key_id => 'aws_access_key_id'
|
212
|
+
# :access_key_id => 'aws_access_key_id',
|
206
213
|
# :secret_access_key => 'aws_secret_access_key',
|
214
|
+
# :region => 'us-east-1'
|
207
215
|
# )
|
208
216
|
# cloud.get_rds_details(:stack_name => 'ShittyStack')
|
209
217
|
#
|
@@ -216,7 +224,7 @@ module Cloudster
|
|
216
224
|
def get_rds_details(options = {})
|
217
225
|
stack_resources = resources(options)
|
218
226
|
rds_resource_ids = get_resource_ids(stack_resources, "AWS::RDS::DBInstance")
|
219
|
-
rds = Fog::AWS::RDS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key)
|
227
|
+
rds = Fog::AWS::RDS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key, :region => @region)
|
220
228
|
rds_details = {}
|
221
229
|
rds_resource_ids.each do |key, value|
|
222
230
|
rds_instance_details = rds.describe_db_instances(value)
|
@@ -229,8 +237,9 @@ module Cloudster
|
|
229
237
|
#
|
230
238
|
# ==== Examples
|
231
239
|
# cloud = Cloudster::Cloud.new(
|
232
|
-
# :access_key_id => 'aws_access_key_id'
|
240
|
+
# :access_key_id => 'aws_access_key_id',
|
233
241
|
# :secret_access_key => 'aws_secret_access_key',
|
242
|
+
# :region => 'us-east-1'
|
234
243
|
# )
|
235
244
|
# cloud.get_ec2_details(:stack_name => 'ShittyStack')
|
236
245
|
#
|
@@ -243,7 +252,7 @@ module Cloudster
|
|
243
252
|
def get_ec2_details(options = {})
|
244
253
|
stack_resources = resources(options)
|
245
254
|
ec2_resource_ids = get_resource_ids(stack_resources, "AWS::EC2::Instance")
|
246
|
-
ec2 = Fog::Compute::AWS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key)
|
255
|
+
ec2 = Fog::Compute::AWS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key, :region => @region)
|
247
256
|
ec2_details = {}
|
248
257
|
ec2_resource_ids.each do |key, value|
|
249
258
|
ec2_instance_details = ec2.describe_instances('instance-id' => value)
|
@@ -256,8 +265,9 @@ module Cloudster
|
|
256
265
|
#
|
257
266
|
# ==== Examples
|
258
267
|
# cloud = Cloudster::Cloud.new(
|
259
|
-
# :access_key_id => 'aws_access_key_id'
|
268
|
+
# :access_key_id => 'aws_access_key_id',
|
260
269
|
# :secret_access_key => 'aws_secret_access_key',
|
270
|
+
# :region => 'us-east-1'
|
261
271
|
# )
|
262
272
|
# cloud.get_elb_details(:stack_name => 'ShittyStack')
|
263
273
|
#
|
@@ -270,7 +280,7 @@ module Cloudster
|
|
270
280
|
def get_elb_details(options = {})
|
271
281
|
stack_resources = resources(options)
|
272
282
|
elb_resource_ids = get_resource_ids(stack_resources, "AWS::ElasticLoadBalancing::LoadBalancer")
|
273
|
-
elb = Fog::AWS::ELB.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key)
|
283
|
+
elb = Fog::AWS::ELB.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key, :region => @region)
|
274
284
|
elb_details = {}
|
275
285
|
elb_resource_ids.each do |key, value|
|
276
286
|
elb_instance_details = elb.describe_load_balancers("LoadBalancerNames" => [value])
|
@@ -283,8 +293,9 @@ module Cloudster
|
|
283
293
|
#
|
284
294
|
# ==== Examples
|
285
295
|
# cloud = Cloudster::Cloud.new(
|
286
|
-
# :access_key_id => 'aws_access_key_id'
|
296
|
+
# :access_key_id => 'aws_access_key_id',
|
287
297
|
# :secret_access_key => 'aws_secret_access_key',
|
298
|
+
# :region => 'us-east-1'
|
288
299
|
# )
|
289
300
|
# cloud.resources(:stack_name => 'RDSStack')
|
290
301
|
#
|
@@ -303,8 +314,9 @@ module Cloudster
|
|
303
314
|
#
|
304
315
|
# ==== Examples
|
305
316
|
# cloud = Cloudster::Cloud.new(
|
306
|
-
# :access_key_id => 'aws_access_key_id'
|
317
|
+
# :access_key_id => 'aws_access_key_id',
|
307
318
|
# :secret_access_key => 'aws_secret_access_key',
|
319
|
+
# :region => 'us-east-1'
|
308
320
|
# )
|
309
321
|
# cloud.describe(:stack_name => 'RDSStack')
|
310
322
|
#
|
@@ -323,8 +335,9 @@ module Cloudster
|
|
323
335
|
#
|
324
336
|
# ==== Examples
|
325
337
|
# cloud = Cloudster::Cloud.new(
|
326
|
-
# :access_key_id => 'aws_access_key_id'
|
338
|
+
# :access_key_id => 'aws_access_key_id',
|
327
339
|
# :secret_access_key => 'aws_secret_access_key',
|
340
|
+
# :region => 'us-east-1'
|
328
341
|
# )
|
329
342
|
# cloud.status(:stack_name => 'RDSStack')
|
330
343
|
#
|
@@ -352,8 +365,9 @@ module Cloudster
|
|
352
365
|
#
|
353
366
|
# ==== Examples
|
354
367
|
# cloud = Cloudster::Cloud.new(
|
355
|
-
# :access_key_id => 'aws_access_key_id'
|
368
|
+
# :access_key_id => 'aws_access_key_id',
|
356
369
|
# :secret_access_key => 'aws_secret_access_key',
|
370
|
+
# :region => 'us-east-1'
|
357
371
|
# )
|
358
372
|
# cloud.get_key_pairs
|
359
373
|
#
|
@@ -363,7 +377,7 @@ module Cloudster
|
|
363
377
|
# ==== Returns
|
364
378
|
# * Array of hashes, example: [{"keyName"=>"default", "keyFingerprint"=>"84:67:e2:f8:04:c1:5f:d4:ff"}]
|
365
379
|
def get_key_pairs
|
366
|
-
ec2 = Fog::Compute::AWS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key)
|
380
|
+
ec2 = Fog::Compute::AWS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key, :region => @region)
|
367
381
|
return ec2.describe_key_pairs.body["keySet"] rescue []
|
368
382
|
end
|
369
383
|
|
@@ -371,8 +385,9 @@ module Cloudster
|
|
371
385
|
#
|
372
386
|
# ==== Examples
|
373
387
|
# cloud = Cloudster::Cloud.new(
|
374
|
-
# :access_key_id => 'aws_access_key_id'
|
388
|
+
# :access_key_id => 'aws_access_key_id',
|
375
389
|
# :secret_access_key => 'aws_secret_access_key',
|
390
|
+
# :region => 'us-east-1'
|
376
391
|
# )
|
377
392
|
# cloud.get_security_groups
|
378
393
|
#
|
@@ -382,7 +397,7 @@ module Cloudster
|
|
382
397
|
# ==== Returns
|
383
398
|
# * Array of hashes containing the security group details
|
384
399
|
def get_security_groups
|
385
|
-
ec2 = Fog::Compute::AWS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key)
|
400
|
+
ec2 = Fog::Compute::AWS.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key, :region => @region)
|
386
401
|
return ec2.describe_security_groups.body["securityGroupInfo"] rescue []
|
387
402
|
end
|
388
403
|
|
data/lib/cloudster/ec2.rb
CHANGED
@@ -62,8 +62,8 @@ module Cloudster
|
|
62
62
|
# )
|
63
63
|
#
|
64
64
|
# ==== Parameters
|
65
|
-
# * options<~Hash> -
|
66
|
-
# *Keys:
|
65
|
+
# * options<~Hash> -
|
66
|
+
# *Keys:
|
67
67
|
# * :name: String containing the name for the Ec2 resource
|
68
68
|
# * :key_name: String containing the name of the keypair to be used for SSH
|
69
69
|
# * :image_id: String containing the AMI image id to be used while creating the Ec2 resource
|
@@ -81,14 +81,14 @@ module Cloudster
|
|
81
81
|
security_groups = options[:security_groups].to_a
|
82
82
|
properties.merge!({"SecurityGroups" => security_groups})
|
83
83
|
end
|
84
|
-
template = {'Resources' => {
|
85
|
-
options[:name] => {
|
84
|
+
template = {'Resources' => {
|
85
|
+
options[:name] => {
|
86
86
|
'Type' => 'AWS::EC2::Instance',
|
87
87
|
'Properties' => properties
|
88
88
|
}
|
89
89
|
}
|
90
90
|
}
|
91
|
-
return template
|
91
|
+
return template
|
92
92
|
end
|
93
93
|
|
94
94
|
end
|
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.13.
|
4
|
+
version: 2.13.1
|
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-12-
|
12
|
+
date: 2012-12-18 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: 907847761
|
162
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
163
|
none: false
|
164
164
|
requirements:
|