class Kitchen::Terraform::Command::Validate::PreZeroFifteenZero

The root module is validated by running a command like the following example:

terraform validate \
  [-no-color] \
  [-var=<variables.first>...] \
  [-var-file=<variable_files.first>...] \
  <directory>

Attributes

color[RW]
var[RW]
var_file[RW]

Public Class Methods

new(config:) click to toggle source

initialize prepares a new instance of the class.

@param config [Hash] the configuration of the driver. @option config [Boolean] :color a toggle of colored output from the Terraform client. @option config [Array<String>] :variable_files a list of pathnames of Terraform variable files to evaluate. @option config [Hash{String=>String}] :variables a mapping of Terraform variables to evaluate. @return [Kitchen::Terraform::Command::Validate]

# File lib/kitchen/terraform/command/validate/pre_zero_fifteen_zero.rb, line 40
def initialize(config:)
  self.color = ::Kitchen::Terraform::CommandFlag::Color.new enabled: config.fetch(:color)
  self.var_file = ::Kitchen::Terraform::CommandFlag::VarFile.new pathnames: config.fetch(:variable_files)
  self.var = ::Kitchen::Terraform::CommandFlag::Var.new arguments: config.fetch(:variables)
end

Public Instance Methods

to_s() click to toggle source

@return [String] the command with flags.

# File lib/kitchen/terraform/command/validate/pre_zero_fifteen_zero.rb, line 47
def to_s
  "validate " \
  "#{color} " \
  "#{var} " \
  "#{var_file}"
end