Class: Terraspace::Terraform::Args::Custom

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
DslEvaluator, Dsl
Defined in:
lib/terraspace/terraform/args/custom.rb

Constant Summary

Constants included from Shorthands

Shorthands::COMMANDS_WITH_INPUT, Shorthands::COMMANDS_WITH_LOCKING, Shorthands::COMMANDS_WITH_PARALLELISM, Shorthands::COMMANDS_WITH_VARS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Dsl

#command, #each_command, #shorthand?, #shorthand_commands

Methods included from Shorthands

#shorthands

Constructor Details

#initialize(mod, name) ⇒ Custom

Returns a new instance of Custom.



8
9
10
11
# File 'lib/terraspace/terraform/args/custom.rb', line 8

def initialize(mod, name)
  @mod, @name = mod, name
  @commands = {}
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/terraspace/terraform/args/custom.rb', line 7

def name
  @name
end

Instance Method Details

#argsObject



20
21
22
# File 'lib/terraspace/terraform/args/custom.rb', line 20

def args
  terraform_args + var_file_args
end

#buildObject



13
14
15
16
17
# File 'lib/terraspace/terraform/args/custom.rb', line 13

def build
  evaluate_file("#{Terraspace.root}/config/args/terraform.rb")
  evaluate_file("#{@mod.root}/config/args/terraform.rb")
  @commands.deep_stringify_keys!
end

#env_varsObject



24
25
26
27
# File 'lib/terraspace/terraform/args/custom.rb', line 24

def env_vars
  build
  dig("env", {})
end