Sha256: bd5056a221a8858bbe97b7cd863c5e71afab132ce1f6f56721665ab21ed783b0

Contents?: true

Size: 808 Bytes

Versions: 2

Compression:

Stored size: 808 Bytes

Contents

module Lono::Cfn
  class Plan < Base
    def run
      if stack_exists?(@stack)
        for_update
      else
        for_create
      end
    end

    def for_update
      # Allow passing down of the build object from Cfn::Deploy so build.all only runs once.
      # Fallback to creating new build object but still pass one build object instance down.
      @options[:build] ||= build
      if @options[:iam] == true
        @options[:iam] = Lono::Cfn::Deploy::Iam.new(@options)
      end
      Template.new(@options).run
      Param.new(@options).run
      changeset = Changeset.new(@options)
      changeset.create
      changeset # return changeset so it can be executed
    end

    def for_create
      New.new(@options).run
    end

    def for_delete
      Delete.new(@options).run
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc2 lib/lono/cfn/plan.rb
lono-8.0.0.pre.rc1 lib/lono/cfn/plan.rb