Class: TerraformConfig::VolumeSet

Inherits:
Base
  • Object
show all
Defined in:
lib/core/terraform_config/volume_set.rb

Overview

rubocop:disable Metrics/ClassLength

Constant Summary collapse

PERFORMANCE_CLASSES =
%w[general-purpose-ssd high-throughput-ssd].freeze
FILE_SYSTEM_TYPES =
%w[xfs ext4].freeze
MIN_CAPACITY =
10
MIN_SCALING_FACTOR =
1.1

Constants included from Dsl

Dsl::EXPRESSION_PATTERN

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#locals

Methods included from Dsl

#argument, #block

Constructor Details

#initialize(gvc:, name:, initial_capacity:, performance_class:, file_system_type:, storage_class_suffix: nil, description: nil, tags: nil, snapshots: nil, autoscaling: nil) ⇒ VolumeSet

rubocop:disable Metrics/ParameterLists, Metrics/MethodLength



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/core/terraform_config/volume_set.rb', line 13

def initialize( # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
  gvc:,
  name:,
  initial_capacity:,
  performance_class:,
  file_system_type:,
  storage_class_suffix: nil,
  description: nil,
  tags: nil,
  snapshots: nil,
  autoscaling: nil
)
  super()

  @gvc = gvc
  @name = name
  @initial_capacity = initial_capacity
  @performance_class = performance_class
  @file_system_type = file_system_type
  @storage_class_suffix = storage_class_suffix
  @description = description
  @tags = tags
  @snapshots = snapshots
  @autoscaling = autoscaling

  validate_attributes!
end

Instance Attribute Details

#autoscalingObject (readonly)

Returns the value of attribute autoscaling.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def autoscaling
  @autoscaling
end

#descriptionObject (readonly)

Returns the value of attribute description.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def description
  @description
end

#file_system_typeObject (readonly)

Returns the value of attribute file_system_type.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def file_system_type
  @file_system_type
end

#gvcObject (readonly)

Returns the value of attribute gvc.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def gvc
  @gvc
end

#initial_capacityObject (readonly)

Returns the value of attribute initial_capacity.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def initial_capacity
  @initial_capacity
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def name
  @name
end

#performance_classObject (readonly)

Returns the value of attribute performance_class.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def performance_class
  @performance_class
end

#snapshotsObject (readonly)

Returns the value of attribute snapshots.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def snapshots
  @snapshots
end

#storage_class_suffixObject (readonly)

Returns the value of attribute storage_class_suffix.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def storage_class_suffix
  @storage_class_suffix
end

#tagsObject (readonly)

Returns the value of attribute tags.



10
11
12
# File 'lib/core/terraform_config/volume_set.rb', line 10

def tags
  @tags
end

Instance Method Details

#importable?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/core/terraform_config/volume_set.rb', line 41

def importable?
  true
end

#referenceObject



45
46
47
# File 'lib/core/terraform_config/volume_set.rb', line 45

def reference
  "cpln_volume_set.#{name}"
end

#to_tfObject



49
50
51
52
53
54
55
# File 'lib/core/terraform_config/volume_set.rb', line 49

def to_tf
  block :resource, :cpln_volume_set, name do
    base_arguments_tf
    snapshots_tf
    autoscaling_tf
  end
end