Class: EbDeployer::AWSDriver::CloudFormationDriver
- Inherits:
-
Object
- Object
- EbDeployer::AWSDriver::CloudFormationDriver
- Defined in:
- lib/eb_deployer/aws_driver/cloud_formation_driver.rb
Instance Method Summary collapse
- #create_stack(name, template, opts) ⇒ Object
- #query_output(name, key) ⇒ Object
- #stack_exists?(name) ⇒ Boolean
- #stack_status(name) ⇒ Object
- #update_stack(name, template, opts) ⇒ Object
Instance Method Details
#create_stack(name, template, opts) ⇒ Object
9 10 11 |
# File 'lib/eb_deployer/aws_driver/cloud_formation_driver.rb', line 9 def create_stack(name, template, opts) cloud_formation.stacks.create(name, template, opts) end |
#query_output(name, key) ⇒ Object
29 30 31 32 |
# File 'lib/eb_deployer/aws_driver/cloud_formation_driver.rb', line 29 def query_output(name, key) output = stack(name).outputs.find { |o| o.key == key } output && output.value end |
#stack_exists?(name) ⇒ Boolean
5 6 7 |
# File 'lib/eb_deployer/aws_driver/cloud_formation_driver.rb', line 5 def stack_exists?(name) stack(name).exists? end |
#stack_status(name) ⇒ Object
25 26 27 |
# File 'lib/eb_deployer/aws_driver/cloud_formation_driver.rb', line 25 def stack_status(name) stack(name).status.downcase.to_sym end |
#update_stack(name, template, opts) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/eb_deployer/aws_driver/cloud_formation_driver.rb', line 13 def update_stack(name, template, opts) begin stack(name).update(opts.merge(:template => template)) rescue AWS::CloudFormation::Errors::ValidationError => e if e. =~ /No updates are to be performed/ log(e.) else raise end end end |