Class: Terraspace::Terraform::Args::Pass

Inherits:
Object
  • Object
show all
Defined in:
lib/terraspace/terraform/args/pass.rb

Instance Method Summary collapse

Constructor Details

#initialize(mod, name, options = {}) ⇒ Pass

Returns a new instance of Pass.



3
4
5
# File 'lib/terraspace/terraform/args/pass.rb', line 3

def initialize(mod, name, options={})
  @mod, @name, @options = mod, name.underscore, options
end

Instance Method Details

#argsObject

map to terraform options and only allow valid terraform options Arg Examples:

-refresh-only
-refresh=false
-var 'foo=bar'


12
13
14
15
16
17
18
19
# File 'lib/terraspace/terraform/args/pass.rb', line 12

def args
  args = pass_args.select do |arg|
    arg_name = get_arg_name(arg)
    terraform_arg_types.include?(arg_name)
  end

  args.map { |arg| "-#{arg}" } # add back in the leading single dash (-)
end