Module: Kitchen::Terraform::ConfigAttribute::Client

Extended by:
Kitchen::Terraform::ConfigAttributeCacher
Included in:
Driver::Terraform
Defined in:
lib/kitchen/terraform/config_attribute/client.rb

Overview

This attribute contains the pathname of the Terraform client to be used by Kitchen-Terraform.

If the value is not an absolute pathname or a relative pathname then Kitchen-Terraform will attempt to find the value in the directories of the ) PATH.

The pathname of any executable file which implements the interfaces of the following Terraform client commands may be specified: apply; destroy; get; init; validate; workspace.

Type

Scalar

Required

False

Default

terraform

Example

client: /usr/local/bin/terraform

Example

client: ./bin/terraform

Example

client: terraform

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Kitchen::Terraform::ConfigAttributeCacher

define_cache, extended

Class Method Details

.included(plugin_class) ⇒ self

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

Parameters:

  • plugin_class (Kitchen::Configurable)

    A plugin class.

Returns:

  • (self)


47
48
49
50
51
52
53
54
55
56
57
# File 'lib/kitchen/terraform/config_attribute/client.rb', line 47

def included(plugin_class)
  ::Kitchen::Terraform::ConfigAttributeDefiner.new(
    attribute: self,
    schema: ::Kitchen::Terraform::ConfigSchemas::String,
  ).define plugin_class: plugin_class
  plugin_class.expand_path_for to_sym do |plugin|
    !::TTY::Which.exist? plugin[to_sym]
  end

  self
end

.to_symSymbol

Returns the symbol corresponding to this attribute.

Returns:

  • (Symbol)

    the symbol corresponding to this attribute.



60
61
62
# File 'lib/kitchen/terraform/config_attribute/client.rb', line 60

def to_sym
  :client
end

Instance Method Details

#config_client_default_valueString

Returns </code>“terraform”</code>.

Returns:

  • (String)

    </code>“terraform”</code>



68
69
70
# File 'lib/kitchen/terraform/config_attribute/client.rb', line 68

def config_client_default_value
  "terraform"
end