Method: Stax::Cli#create

Defined in:
lib/stax/cli/crud.rb

#createObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/stax/cli/crud.rb', line 19

def create
  stacks = stack_objects

  ## filter by stack groups
  unless options[:all]
    stacks.reject! do |s|
      (s.stack_groups.map(&:to_s) & options[:groups]).empty? # test intersection
    end
  end

  stacks.each do |s|
    if s.exists?
      say("Skipping: #{s.stack_name} exists", :yellow)
    elsif y_or_n?("Create #{s.stack_name}?", :yellow)
      s.create
    end
  end
end