class RubyTerraform::Commands::Plan

Wraps the +terraform plan+ command which generates a speculative execution plan, showing what actions Terraform would take to apply the current configuration. This command will not actually perform the planned actions.

You can optionally save the plan to a file, which you can then pass to the {Apply} command to perform exactly the actions described in the plan.

For options accepted on construction, see {#initialize}.

When executing an instance of {Plan} via {#execute}, the following options are supported:

@example Basic Invocation

RubyTerraform::Commands::Plan.new.execute(
  directory: 'infra/networking',
  vars: {
    region: 'eu-central'
  })

Public Instance Methods

arguments(parameters) click to toggle source

@!visibility private

# File lib/ruby_terraform/commands/plan.rb, line 102
def arguments(parameters)
  [parameters[:directory]]
end
options() click to toggle source

@!visibility private

Calls superclass method RubyTerraform::Options::Global#options
# File lib/ruby_terraform/commands/plan.rb, line 80
def options
  %w[
    -compact-warnings
    -destroy
    -detailed-exitcode
    -input
    -lock
    -lock-timeout
    -no-color
    -out
    -parallelism
    -refresh
    -state
    -target
    -var
    -var-file
  ] + super
end
parameter_defaults(_parameters) click to toggle source

@!visibility private

# File lib/ruby_terraform/commands/plan.rb, line 107
def parameter_defaults(_parameters)
  { vars: {}, var_files: [], targets: [] }
end
subcommands() click to toggle source

@!visibility private

# File lib/ruby_terraform/commands/plan.rb, line 73
def subcommands
  %w[plan]
end