Class: RSpec::Terraform::Helpers::Plan

Inherits:
Base
  • Object
show all
Includes:
Actions::Clean, Actions::Init, Actions::Plan, Actions::Remove, Actions::Show, Actions::Validate
Defined in:
lib/rspec/terraform/helpers/plan.rb

Instance Attribute Summary

Attributes inherited from Base

#binary, #configuration_provider, #execution_mode, #logger, #stderr, #stdin, #stdout

Instance Method Summary collapse

Methods included from Actions::Remove

#remove

Methods included from Actions::Show

#show

Methods included from Actions::CommandInstantiation

#instantiate_command

Methods included from Actions::Plan

#plan

Methods included from Actions::Init

#init

Methods included from Actions::Clean

#clean

Methods included from Actions::Validate

#validate

Methods inherited from Base

#initialize

Methods included from Parameters

#resolve_parameters, #with_configuration_provider_parameters, #with_mandatory_parameters, #with_resolved_vars

Constructor Details

This class inherits a constructor from RSpec::Terraform::Helpers::Base

Instance Method Details

#execute(overrides = {}, &block) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rspec/terraform/helpers/plan.rb', line 17

def execute(overrides = {}, &block)
  parameters = resolve_parameters(overrides, &block)

  validate(parameters)
  clean(parameters)
  init(parameters)
  plan_file = plan(parameters)
  plan_contents = show(parameters, plan_file)
  remove(parameters, plan_file)
  parse(plan_contents)
end