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.



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

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

Instance Attribute Details

#bucketObject (readonly)

Returns the value of attribute bucket.



27
28
29
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 27

def bucket
  @bucket
end

#encryptObject (readonly)

Returns the value of attribute encrypt.



27
28
29
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 27

def encrypt
  @encrypt
end

#keyObject (readonly)

Returns the value of attribute key.



27
28
29
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 27

def key
  @key
end

#regionObject (readonly)

Returns the value of attribute region.



27
28
29
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 27

def region
  @region
end

Instance Method Details

#hashObject



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/terraform-wrapper/shared/backends/aws.rb', line 37

def hash
  result = {}

  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?

  result
end