Class: TerraformWrapper::Shared::Backends::AWS

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

Constant Summary collapse

@@default_class =
"terraform-state"
@@type =
"aws"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

configure_logger_for, logger_for

Methods inherited from Common

#type

Constructor Details

#initialize(options:, variables:) ⇒ AWS

Returns a new instance of AWS.



38
39
40
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 38

def initialize(options:, variables:)
  construct(options: options, variables: variables)
end

Instance Attribute Details

#bucketObject (readonly)

Returns the value of attribute bucket.



31
32
33
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 31

def bucket
  @bucket
end

#encryptObject (readonly)

Returns the value of attribute encrypt.



32
33
34
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 32

def encrypt
  @encrypt
end

#keyObject (readonly)

Returns the value of attribute key.



33
34
35
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 33

def key
  @key
end

#regionObject (readonly)

Returns the value of attribute region.



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

def region
  @region
end

Instance Method Details

#hashObject



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 44

def hash()
  result = Hash.new

  result["bucket"]  = @bucket
  result["region"]  = @region
  result["key"]     = @key
  result["encrypt"] = @encrypt.to_s

  result["kms_key_id"] = @kms  unless @kms.nil?
  result["role_arn"]   = @role unless @role.nil?

  return result
end