Class: AWS::CloudFormation::StackCollection
- Inherits:
-
Object
- Object
- AWS::CloudFormation::StackCollection
- Includes:
- AWS::Core::Collection::WithNextToken
- Defined in:
- lib/aws/cloud_formation/stack_collection.rb
Instance Method Summary collapse
- #[](stack_name) ⇒ Object
-
#create(stack_name, template, options = {}) ⇒ Stack
Creates a new stack.
-
#with_status(status_filter) ⇒ StackCollection
Limits the stacks that are enumerated.
Methods included from AWS::Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Instance Method Details
#[](stack_name) ⇒ Object
152 153 154 |
# File 'lib/aws/cloud_formation/stack_collection.rb', line 152 def [] stack_name Stack.new(stack_name, :config => config) end |
#create(stack_name, template, options = {}) ⇒ Stack
Creates a new stack.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/aws/cloud_formation/stack_collection.rb', line 134 def create stack_name, template, = {} client_opts = .dup client_opts[:template] = template apply_stack_name(stack_name, client_opts) apply_template(client_opts) apply_disable_rollback(client_opts) apply_notification_arns(client_opts) apply_parameters(client_opts) apply_timeout(client_opts) resp = client.create_stack(client_opts) Stack.new(stack_name, :config => config, :stack_id => resp.stack_id) end |
#with_status(status_filter) ⇒ StackCollection
Limits the stacks that are enumerated.
cloud_formation.stacks.with_status(:create_complete).each do |stack|
puts stack.name
end
184 185 186 |
# File 'lib/aws/cloud_formation/stack_collection.rb', line 184 def with_status status_filter StackCollection.new(:status_filter => status_filter, :config => config) end |