Class: Stackup::Service
- Inherits:
-
Object
- Object
- Stackup::Service
- Defined in:
- lib/stackup/service.rb
Overview
A handle to CloudFormation.
Instance Method Summary collapse
-
#initialize(cf_client = {}) ⇒ Service
constructor
A new instance of Service.
-
#stack(name, options = {}) ⇒ Stackup::Stack
The named stack.
-
#stack_names ⇒ Enumeration<String>
Names of existing stacks.
Constructor Details
#initialize(cf_client = {}) ⇒ Service
Returns a new instance of Service.
12 13 14 15 |
# File 'lib/stackup/service.rb', line 12 def initialize(cf_client = {}) cf_client = Aws::CloudFormation::Client.new(cf_client) if cf_client.is_a?(Hash) @cf_client = cf_client end |
Instance Method Details
#stack(name, options = {}) ⇒ Stackup::Stack
Returns the named stack.
19 20 21 |
# File 'lib/stackup/service.rb', line 19 def stack(name, = {}) Stack.new(name, cf_client, ) end |
#stack_names ⇒ Enumeration<String>
Returns names of existing stacks.
25 26 27 28 29 30 31 32 33 |
# File 'lib/stackup/service.rb', line 25 def stack_names Enumerator.new do |y| cf_client.describe_stacks.each do |response| response.stacks.each do |stack| y << stack.stack_name end end end end |