jzimmek-ec2-dsl 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -298,6 +298,28 @@ The keypair attribute describes the `keypair` value of your instance. Can be app
298
298
  end
299
299
  ...
300
300
 
301
+ === availability_zone
302
+
303
+ The availability_zone attribute describes the `availability_zone` value of your instance. Can be applied to a "cloud", "group" and "instance" block.
304
+
305
+ ...
306
+ cloud "my_network" do
307
+ availability_zone "eu-west-1a"
308
+ end
309
+ ...
310
+
311
+ ...
312
+ group "webserver" do
313
+ availability_zone "eu-west-1b"
314
+ end
315
+ ...
316
+
317
+ ...
318
+ instance "web01" do
319
+ availability_zone "us-east-1a"
320
+ end
321
+ ...
322
+
301
323
  === ami, ari and aki
302
324
 
303
325
  The ami, ari and aki attribute describes the 1:1 EC2 counterparts of your instance. Can be applied to a "group" and "instance" block.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
data/ec2-dsl.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ec2-dsl}
5
- s.version = "0.2.0"
5
+ s.version = "0.3.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jan Zimmek"]
9
- s.date = %q{2009-06-13}
9
+ s.date = %q{2009-06-14}
10
10
  s.description = %q{A DSL to model your EC2 cloud written in ruby.}
11
11
  s.email = %q{jan.zimmek@web.de}
12
12
  s.extra_rdoc_files = [
data/lib/ec2/dsl/cloud.rb CHANGED
@@ -9,6 +9,7 @@ module Ec2
9
9
  define_attribute :security_group
10
10
  define_attribute :region
11
11
  define_attribute :domain
12
+ define_attribute :availability_zone
12
13
 
13
14
  attr_accessor :groups
14
15
 
data/lib/ec2/dsl/group.rb CHANGED
@@ -10,6 +10,7 @@ module Ec2
10
10
  define_attribute :region
11
11
  define_attribute :ami, :ari, :aki
12
12
  define_attribute :domain
13
+ define_attribute :availability_zone
13
14
 
14
15
  attr_accessor :instances
15
16
 
@@ -10,6 +10,7 @@ module Ec2
10
10
  define_attribute :ami, :ari, :aki
11
11
  define_attribute :hostname, :domain
12
12
  define_attribute :elastic_ip
13
+ define_attribute :availability_zone
13
14
 
14
15
  def initialize(name, container)
15
16
  hostname(name)
data/test/ec2-dsl_test.rb CHANGED
@@ -195,4 +195,37 @@ class Ec2DslTest < Test::Unit::TestCase
195
195
 
196
196
  end
197
197
 
198
+ should "create an instance having a availability zone" do
199
+
200
+ cloud "my_network", false do
201
+ group "default" do
202
+ instance "web01" do
203
+ availability_zone "zone1"
204
+ end
205
+ end
206
+ end
207
+
208
+ assert_equal "zone1", @my_network.instances.first.availability_zone_value
209
+
210
+ cloud "my_network", false do
211
+ group "default" do
212
+ availability_zone "zone2"
213
+ instance "web01"
214
+ end
215
+ end
216
+
217
+ assert_equal "zone2", @my_network.instances.first.availability_zone_value
218
+
219
+ cloud "my_network", false do
220
+ availability_zone "zone3"
221
+ group "default" do
222
+ instance "web01"
223
+ end
224
+ end
225
+
226
+ assert_equal "zone3", @my_network.instances.first.availability_zone_value
227
+
228
+
229
+ end
230
+
198
231
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jzimmek-ec2-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Zimmek
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-13 00:00:00 -07:00
12
+ date: 2009-06-14 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15