cloudster 2.12.0 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -51,16 +51,16 @@ Create AWS resources :
51
51
 
52
52
  Make a cloud :
53
53
 
54
- cloud = Cloudster::Cloud.new(:access_key_id => 'accesskeyid', :secret_access_key => 'topsecretaccesskey')
54
+ cloud = Cloudster::Cloud.new(:access_key_id => 'accesskeyid', :secret_access_key => 'topsecretaccesskey', :region => 'us-west-1')
55
55
 
56
56
  Get the CloudFormation template for the stack :
57
-
57
+
58
58
  cloud.template(:resources => [app_server, app_server_2, load_balancer, database], :description => 'Description of the stack')
59
59
 
60
60
  Get the CloudFormation template for a resource as a Ruby Hash :
61
61
 
62
62
  app_server.template
63
-
63
+
64
64
  Cloudster can also do things on the AWS Cloud :
65
65
 
66
66
  - Provision the stack :
@@ -115,7 +115,7 @@ Cloudster can also do things on the AWS Cloud :
115
115
 
116
116
  cloud.get_security_groups
117
117
 
118
- # More coming soon !
118
+ - ### More coming soon ..
119
119
 
120
120
  ----------------
121
121
 
@@ -153,7 +153,7 @@ can be applied as quickly as possible:
153
153
 
154
154
  3. **Update the `README`:** If the patch adds or modifies a major feature,
155
155
  modify the `README.md` file to reflect that. Again if you're not an
156
- expert with Markdown syntax, it's really easy to learn. Check out [Dillinger](http://dillinger.io/) to
156
+ expert with Markdown syntax, it's really easy to learn. Check out [Prose.io](http://prose.io/) to
157
157
  try it out.
158
158
 
159
159
  4. **Push it:** Once you're ready, push your changes to a topic branch
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.12.0
1
+ 2.13.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cloudster"
8
- s.version = "2.12.0"
8
+ s.version = "2.13.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-30"
12
+ s.date = "2012-12-17"
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 = [
@@ -10,8 +10,10 @@ module Cloudster
10
10
  #
11
11
  # ==== Parameters
12
12
  # * options<~Hash>
13
- # * :access_key_id : A string containing the AWS access key ID.
14
- # * :secret_access_key : A string containing the AWS secret access key.
13
+ # * :access_key_id : A string containing the AWS access key ID (Required)
14
+ # * :secret_access_key : A string containing the AWS secret access key (Required)
15
+ # * :region : A string containing the region where the stack should be created/updated (Optional). Can be one of
16
+ # us-east-1(default), us-west-1, us-west-2, eu-west-1, ap-southeast-1, ap-northeast-1, ap-southeast-2, sa-east-1
15
17
  #
16
18
  # ==== Examples
17
19
  # cloud = Cloudster::Cloud.new(
@@ -20,9 +22,14 @@ module Cloudster
20
22
  # )
21
23
  def initialize(options = {})
22
24
  require_options(options, [:access_key_id, :secret_access_key])
25
+ @region = options[:region]
23
26
  @access_key_id = options[:access_key_id]
24
27
  @secret_access_key = options[:secret_access_key]
25
- @cloud_formation = Fog::AWS::CloudFormation.new(:aws_access_key_id => @access_key_id, :aws_secret_access_key => @secret_access_key)
28
+ @cloud_formation = Fog::AWS::CloudFormation.new(
29
+ :aws_access_key_id => @access_key_id,
30
+ :aws_secret_access_key => @secret_access_key,
31
+ :region => @region
32
+ )
26
33
  end
27
34
 
28
35
  # Generates CloudFormation Template for the stack
@@ -6,7 +6,7 @@ describe Cloudster::Cloud do
6
6
  expect { Cloudster::Cloud.new() }.to raise_error(ArgumentError, 'Missing required argument: access_key_id,secret_access_key')
7
7
  end
8
8
  it "should not raise argument error if all arguments are provided" do
9
- expect { Cloudster::Cloud.new(:access_key_id => 'test', :secret_access_key => 'test') }.to_not raise_error
9
+ expect { Cloudster::Cloud.new(:access_key_id => 'test', :secret_access_key => 'test', :region => 'us-east-1') }.to_not raise_error
10
10
  end
11
11
  end
12
12
  describe '#template' do
@@ -77,10 +77,10 @@ describe Cloudster::Cloud do
77
77
  end
78
78
  it "should trigger stack creation" do
79
79
  cloud_formation = double('CloudFormation')
80
- Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test').and_return cloud_formation
80
+ Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test', :region => nil).and_return cloud_formation
81
81
  ec2 = Cloudster::Ec2.new(:key_name => 'testkey', :image_id => 'image_id', :name => 'name')
82
82
  elb = Cloudster::Elb.new(:name => 'ELB', :instance_names => ['name','name1'])
83
- rds = Cloudster::Rds.new(:name => 'MySqlDB', :storage_size => '10')
83
+ rds = Cloudster::Rds.new(:name => 'MySqlDB', :storage_size => '10')
84
84
  cloud = Cloudster::Cloud.new(:access_key_id => 'test', :secret_access_key => 'test')
85
85
  cloud_formation.should_receive('create_stack').with('stack_name', 'TemplateBody' => cloud.template(:resources => [ec2, elb, rds], :description => 'testDescription'))
86
86
  cloud.provision(:resources => [ec2, elb, rds], :stack_name => 'stack_name', :description => 'testDescription')
@@ -95,7 +95,7 @@ describe Cloudster::Cloud do
95
95
  end
96
96
  it "should trigger stack update" do
97
97
  cloud_formation = double('CloudFormation')
98
- Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test').and_return cloud_formation
98
+ Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test', :region => nil).and_return cloud_formation
99
99
  ec2 = Cloudster::Ec2.new(:key_name => 'testkey', :image_id => 'image_id', :name => 'name')
100
100
  cloud = Cloudster::Cloud.new(:access_key_id => 'test', :secret_access_key => 'test')
101
101
  cloud_formation.should_receive('update_stack').with('stack_name', 'TemplateBody' => cloud.template(:resources => [ec2], :description => 'testDescription'))
@@ -106,7 +106,7 @@ describe Cloudster::Cloud do
106
106
  describe '#events' do
107
107
  it "should trigger 'describe stack events' request" do
108
108
  cloud_formation = double('CloudFormation')
109
- Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test').and_return cloud_formation
109
+ Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test', :region => nil).and_return cloud_formation
110
110
  cloud = Cloudster::Cloud.new(:access_key_id => 'test', :secret_access_key => 'test')
111
111
  cloud_formation.should_receive('describe_stack_events').with('stack_name')
112
112
  cloud.events(:stack_name => 'stack_name')
@@ -120,7 +120,7 @@ describe Cloudster::Cloud do
120
120
  end
121
121
  it "should trigger 'delete stack' request" do
122
122
  cloud_formation = double('CloudFormation')
123
- Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test').and_return cloud_formation
123
+ Fog::AWS::CloudFormation.should_receive(:new).with(:aws_access_key_id => 'test', :aws_secret_access_key => 'test', :region => nil).and_return cloud_formation
124
124
  cloud = Cloudster::Cloud.new(:access_key_id => 'test', :secret_access_key => 'test')
125
125
  cloud_formation.should_receive('delete_stack').with('stack_name')
126
126
  cloud.delete(:stack_name => 'stack_name')
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.12.0
4
+ version: 2.13.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-30 00:00:00.000000000 Z
12
+ date: 2012-12-17 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: -396938047
161
+ hash: -21542097
162
162
  required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  none: false
164
164
  requirements: