Method: Lono::Sets::Create#save

Defined in:
lib/lono/sets/create.rb

#saveObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/lono/sets/create.rb', line 3

def save
  message = "Creating #{@stack.color(:green)} stack set."
  if @options[:noop]
    puts "NOOP #{message}"
    return
  end

  if stack_set_exists?(@stack)
    puts "Cannot create #{@stack.color(:green)} stack set because it already exists.".color(:red)
    return
  end

  unless File.exist?(template_path)
    puts "Cannot create #{@stack.color(:green)} template not found: #{template_path}."
    return
  end

  options = build_options
  show_options(options, "cfn.create_stack_set")

  sure?("Are you sure you want to create the #{@stack} stack set?")

  cfn.create_stack_set(options) # resp.stack_set_id => String. There is no resp.operation_id
  puts message unless @options[:mute]
  true # There is no resp.operation_id
end