Class: Stack
- Inherits:
-
Object
- Object
- Stack
- Defined in:
- lib/roark/stack.rb
Instance Method Summary collapse
- #create(args) ⇒ Object
- #destroy ⇒ Object
- #exists? ⇒ Boolean
- #in_progress? ⇒ Boolean
-
#initialize(args) ⇒ Stack
constructor
A new instance of Stack.
- #instance_id ⇒ Object
- #success? ⇒ Boolean
Constructor Details
Instance Method Details
#create(args) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/roark/stack.rb', line 10 def create(args) @logger.info "Creating Cloud Formation stack '#{@name}' in '#{@region}'." create_stack.create :name => @name, :parameters => args[:parameters], :template => args[:template] end |
#destroy ⇒ Object
17 18 19 20 |
# File 'lib/roark/stack.rb', line 17 def destroy @logger.info "Destroying Cloud Formation stack '#{@name}'." destroy_stack.destroy @name end |
#exists? ⇒ Boolean
22 23 24 |
# File 'lib/roark/stack.rb', line 22 def exists? stack_status.exists? @name end |
#in_progress? ⇒ Boolean
26 27 28 |
# File 'lib/roark/stack.rb', line 26 def in_progress? status =~ /^CREATE_IN_PROGRESS$/ end |
#instance_id ⇒ Object
34 35 36 |
# File 'lib/roark/stack.rb', line 34 def instance_id outputs.find {|o| o.key == 'InstanceId'}.value end |
#success? ⇒ Boolean
30 31 32 |
# File 'lib/roark/stack.rb', line 30 def success? status =~ /^CREATE_COMPLETE$/ end |