Module: Terraspace::Compiler::Dsl::Syntax::Mod::Backend

Defined in:
lib/terraspace/compiler/dsl/syntax/mod/backend.rb

Instance Method Summary collapse

Instance Method Details

#backend(name, props = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/terraspace/compiler/dsl/syntax/mod/backend.rb', line 3

def backend(name, props={})
  terraform = @structure[:terraform] ||= {}
  backend = terraform[:backend] ||= {}
  expansion_all!(name, props)
  backend[name] = props
end

#backend_expand(backend_name, string) ⇒ Object

DEPRECATED: Will be removed in future release



26
27
28
29
# File 'lib/terraspace/compiler/dsl/syntax/mod/backend.rb', line 26

def backend_expand(backend_name, string)
  logger.info "DEPRECATED backend_expand: instead use expansion(string)"
  Terraspace::Compiler::Expander.new(@mod, backend_name).expansion(string)
end

#expansion(string, opts = {}) ⇒ Object

Can set opts to explicitly use an specific backend. Example:

opts = {backend: s3}

Else Terraspace autodetects the backend installed.



20
21
22
23
# File 'lib/terraspace/compiler/dsl/syntax/mod/backend.rb', line 20

def expansion(string, opts={})
  expander = Terraspace::Compiler::Expander.autodetect(@mod, opts)
  expander.expansion(string)
end

#expansion_all!(backend_name, props = {}) ⇒ Object



10
11
12
# File 'lib/terraspace/compiler/dsl/syntax/mod/backend.rb', line 10

def expansion_all!(backend_name, props={})
  Terraspace::Compiler::Expander.new(@mod, backend_name).expand(props)
end