class RakeTerraform::ApplyTask::Config

Configuration data for terraform apply task

Attributes

plan[W]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/rake-terraform/apply_task/config.rb, line 11
def initialize
  # initialize RakeTerraform::EnvProcess
  super
end

Public Instance Methods

execution_path() click to toggle source
# File lib/rake-terraform/apply_task/config.rb, line 16
def execution_path
  @execution_path ||= File.expand_path 'terraform'
end
execution_path=(dir) click to toggle source

setter method for execution_path triggers setters for tf_environment and state_file so that these are dynamically updated on change (but only if we are using directory state, and not explicit path to a state file)

# File lib/rake-terraform/apply_task/config.rb, line 23
def execution_path=(dir)
  @tf_environment = dir
  @state_file = tf_state_file if @state_dir
  @execution_path = dir
end
opts() click to toggle source
# File lib/rake-terraform/apply_task/config.rb, line 33
def opts
  Map.new(plan: plan,
          execution_path: execution_path,
          unique_state: unique_state,
          state_file: state_file)
end
plan() click to toggle source
# File lib/rake-terraform/apply_task/config.rb, line 29
def plan
  @plan ||= File.expand_path(default_plan)
end

Private Instance Methods

default_plan() click to toggle source
# File lib/rake-terraform/apply_task/config.rb, line 42
def default_plan
  File.join('output', 'terraform', 'plan.tf')
end