Class: Kitchen::Terraform::SystemAttrsOutputsResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/terraform/system_attrs_outputs_resolver.rb

Overview

SystemAttrsOutputsResolver is the class of objects which resolve for systems the attrs which are derived from Terraform outputs.

Instance Method Summary collapse

Constructor Details

#initialize(attrs:) ⇒ Kitchen::Terraform::SystemAttrsOutputsResolver

#initialize prepares a new instance of the class.

Parameters:

  • attrs (Hash)

    a container for attributes.



28
29
30
# File 'lib/kitchen/terraform/system_attrs_outputs_resolver.rb', line 28

def initialize(attrs:)
  self.attrs = attrs
end

Instance Method Details

#resolve(attrs_outputs:, outputs:) ⇒ self

#resolve fetches Terraform outputs and associates them with InSpec attributes.

Parameters:

  • attrs_outputs (Hash{String=>String})

    a mapping of InSpec attribute names to Terraform output names.

  • outputs (Hash{String=>Hash})

    Terraform outputs.

Returns:

  • (self)

Raises:

  • (Kitchen::ClientError)

    if the resolution fails.



38
39
40
41
42
43
# File 'lib/kitchen/terraform/system_attrs_outputs_resolver.rb', line 38

def resolve(attrs_outputs:, outputs:)
  resolve_defaults outputs: outputs
  resolve_configuration attrs_outputs: attrs_outputs

  self
end