Class: TerraformConfig::Gvc

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

Constant Summary

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(name:, description: nil, tags: nil, domain: nil, locations: nil, pull_secrets: nil, env: nil, load_balancer: nil) ⇒ Gvc

rubocop:disable Metrics/ParameterLists



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/core/terraform_config/gvc.rb', line 7

def initialize( # rubocop:disable Metrics/ParameterLists
  name:,
  description: nil,
  tags: nil,
  domain: nil,
  locations: nil,
  pull_secrets: nil,
  env: nil,
  load_balancer: nil
)
  super()

  @name = name
  @description = description
  @tags = tags
  @domain = domain
  @locations = locations
  @pull_secrets = pull_secrets
  @env = env
  @load_balancer = load_balancer&.deep_underscore_keys&.deep_symbolize_keys
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def description
  @description
end

#domainObject (readonly)

Returns the value of attribute domain.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def domain
  @domain
end

#envObject (readonly)

Returns the value of attribute env.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def env
  @env
end

#load_balancerObject (readonly)

Returns the value of attribute load_balancer.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def load_balancer
  @load_balancer
end

#locationsObject (readonly)

Returns the value of attribute locations.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def locations
  @locations
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def name
  @name
end

#pull_secretsObject (readonly)

Returns the value of attribute pull_secrets.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def pull_secrets
  @pull_secrets
end

#tagsObject (readonly)

Returns the value of attribute tags.



5
6
7
# File 'lib/core/terraform_config/gvc.rb', line 5

def tags
  @tags
end

Instance Method Details

#importable?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/core/terraform_config/gvc.rb', line 29

def importable?
  true
end

#referenceObject



33
34
35
# File 'lib/core/terraform_config/gvc.rb', line 33

def reference
  "cpln_gvc.#{name}"
end

#to_tfObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/core/terraform_config/gvc.rb', line 37

def to_tf
  block :resource, :cpln_gvc, name do
    argument :name, name
    argument :description, description, optional: true
    argument :tags, tags, optional: true

    argument :domain, domain, optional: true
    argument :locations, locations, optional: true
    argument :pull_secrets, pull_secrets, optional: true
    argument :env, env, optional: true

    load_balancer_tf
  end
end