Class: TerraformConfig::Secret
- Defined in:
- lib/core/terraform_config/secret.rb
Overview
rubocop:disable Metrics/ClassLength
Constant Summary collapse
- REQUIRED_DATA_KEYS =
{ "aws" => i[secret_key access_key], "azure-connector" => i[url code], "ecr" => i[secret_key access_key repos], "keypair" => i[secret_key], "nats-account" => i[account_id private_key], "opaque" => i[payload], "tls" => i[key cert], "userpass" => i[username password], "dictionary" => [] }.freeze
Constants included from Dsl
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #importable? ⇒ Boolean
-
#initialize(name:, type:, data:, description: nil, tags: nil) ⇒ Secret
constructor
A new instance of Secret.
- #reference ⇒ Object
- #to_tf ⇒ Object
Methods inherited from Base
Methods included from Dsl
Constructor Details
#initialize(name:, type:, data:, description: nil, tags: nil) ⇒ Secret
Returns a new instance of Secret.
19 20 21 22 23 24 25 26 27 |
# File 'lib/core/terraform_config/secret.rb', line 19 def initialize(name:, type:, data:, description: nil, tags: nil) super() @name = name @type = type @description = description = @data = prepare_data(type: type, data: data) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
17 18 19 |
# File 'lib/core/terraform_config/secret.rb', line 17 def data @data end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
17 18 19 |
# File 'lib/core/terraform_config/secret.rb', line 17 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/core/terraform_config/secret.rb', line 17 def name @name end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
17 18 19 |
# File 'lib/core/terraform_config/secret.rb', line 17 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
17 18 19 |
# File 'lib/core/terraform_config/secret.rb', line 17 def type @type end |
Instance Method Details
#importable? ⇒ Boolean
29 30 31 |
# File 'lib/core/terraform_config/secret.rb', line 29 def importable? true end |
#reference ⇒ Object
33 34 35 |
# File 'lib/core/terraform_config/secret.rb', line 33 def reference "cpln_secret.#{name}" end |
#to_tf ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/core/terraform_config/secret.rb', line 37 def to_tf block :resource, :cpln_secret, name do argument :name, name argument :description, description, optional: true argument :tags, , optional: true secret_data end end |