Class: TerraformWrapper::Shared::Backends::Common

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/terraform-wrapper/shared/backends/common.rb

Direct Known Subclasses

AWS, Azure, Local

Constant Summary collapse

@@ext =
'.tfstate'

Instance Method Summary collapse

Methods included from Logging

configure_logger_for, logger_for

Constructor Details

#initialize(options:, variables:) ⇒ Common

Returns a new instance of Common.



29
30
31
# File 'lib/terraform-wrapper/shared/backends/common.rb', line 29

def initialize(options:, variables:)
  logger.fatal('This class should not be used directly! Please create a backend-specific class instead!')
end

Instance Method Details

#hashObject



35
36
37
# File 'lib/terraform-wrapper/shared/backends/common.rb', line 35

def hash
  logger.fatal("The backend specific class should override the 'hash' method to return a hash of parameters for Terraform to set!")
end

#typeObject



41
42
43
44
45
46
47
# File 'lib/terraform-wrapper/shared/backends/common.rb', line 41

def type
  unless @@type.is_a?(String)
    logger.fatal("The backend specific class should set the 'type' class variable to a string!")
  end

  @@type
end