Module: Kitchen::Terraform::Configurable

Included in:
Driver::Terraform, Provisioner::Terraform, Kitchen::Transport::Terraform, Verifier::Terraform
Defined in:
lib/kitchen/terraform/configurable.rb

Overview

Refinements to Kitchen::Configurable. This class implements the interface of Kitchen::Configurable which requires the following Reek suppressions: :reek:MissingSafeMethod { exclude: [ finalize_config! ] }

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(configurable_class) ⇒ self

A callback to define the plugin version which is invoked when this module is included in a plugin class.

Returns:

  • (self)


32
33
34
35
# File 'lib/kitchen/terraform/configurable.rb', line 32

def self.included(configurable_class)
  ::Kitchen::Terraform::Version.assign_plugin_version configurable_class: configurable_class
  self
end

Instance Method Details

#finalize_config!(instance) ⇒ self

#finalize_config! invokes the super implementation and then defines the workspace name and version requirement.

Parameters:

  • instance (Kitchen::Instance)

    an associated instance.

Returns:

  • (self)

Raises:

  • (Kitchen::ClientError)

    if the instance is nil.



42
43
44
45
46
# File 'lib/kitchen/terraform/configurable.rb', line 42

def finalize_config!(instance)
  super instance
  self.version_requirement = ::Gem::Requirement.new ">= 0.11.4", "< 2.0.0"
  self.workspace_name = "kitchen-terraform-#{::Shellwords.escape instance.name}"
end