Class: TerraformConfig::Identity

Inherits:
Base
  • Object
show all
Defined in:
lib/core/terraform_config/identity.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(gvc:, name:, description: nil, tags: nil) ⇒ Identity

Returns a new instance of Identity.



7
8
9
10
11
12
13
14
# File 'lib/core/terraform_config/identity.rb', line 7

def initialize(gvc:, name:, description: nil, tags: nil)
  super()

  @gvc = gvc
  @name = name
  @description = description
  @tags = tags
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#gvcObject (readonly)

Returns the value of attribute gvc.



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

def gvc
  @gvc
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#tagsObject (readonly)

Returns the value of attribute tags.



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

def tags
  @tags
end

Instance Method Details

#importable?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/core/terraform_config/identity.rb', line 16

def importable?
  true
end

#referenceObject



20
21
22
# File 'lib/core/terraform_config/identity.rb', line 20

def reference
  "cpln_identity.#{name}"
end

#to_tfObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/core/terraform_config/identity.rb', line 24

def to_tf
  block :resource, :cpln_identity, name do
    argument :gvc, gvc

    argument :name, name
    argument :description, description, optional: true

    argument :tags, tags, optional: true
  end
end