Class: LonoCfn::Create

Inherits:
Base
  • Object
show all
Defined in:
lib/lono_cfn/create.rb

Instance Method Summary collapse

Methods inherited from Base

#check_files, #check_for_errors, #convention_path, #detect_format, #exist_unless_updatable, #generate_params, #generate_templates, #get_source_path, #initialize, #quit, #run, #stack_status

Methods included from Util

#are_you_sure?

Methods included from AwsServices

#cfn, #stack_exists?, #testing_update?

Constructor Details

This class inherits a constructor from LonoCfn::Base

Instance Method Details

#create_stack(params) ⇒ Object

aws cloudformation create-stack –stack-name prod-hi-123456789 –parameters file://output/params/prod-hi-123456789.json –template-body file://output/prod-hi.json



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/lono_cfn/create.rb', line 9

def create_stack(params)
  if stack_exists?(@stack_name)
    puts "Cannot create '#{@stack_name}' stack because it already exists."
    return
  end

  template_body = IO.read(@template_path)
  message = "Creating #{@stack_name} stack."
  if @options[:noop]
    message = "NOOP #{message}"
  else
    cfn.create_stack(
      stack_name: @stack_name,
      template_body: template_body,
      parameters: params#,
      # capabilities: ["CAPABILITY_IAM"]
    )
  end
  puts message unless @options[:mute]
end

#save_stack(params) ⇒ Object

save_stack is the interface method



4
5
6
# File 'lib/lono_cfn/create.rb', line 4

def save_stack(params)
  create_stack(params)
end