class Terrafying::RootContext

Public Class Methods

new() click to toggle source
Calls superclass method Terrafying::Context::new
# File lib/terrafying/generator.rb, line 325
def initialize
  super
  @providers = {}
end

Public Instance Methods

backend(name, spec) click to toggle source
# File lib/terrafying/generator.rb, line 330
def backend(name, spec)
  @output['terraform'] = {
    backend: {
      name => spec
    }
  }
end
generate(&block) click to toggle source
# File lib/terrafying/generator.rb, line 338
def generate(&block)
  instance_eval(&block)
end
method_missing(fn, *args) click to toggle source
# File lib/terrafying/generator.rb, line 342
def method_missing(fn, *args)
  resource(fn, args.shift.to_s, args.first)
end
output_with_children() click to toggle source
# File lib/terrafying/generator.rb, line 346
def output_with_children
  PROVIDER_DEFAULTS.each do |name, spec|
    unless key_exists_spec_differs(provider_key(name, spec), name, spec)
      provider(name, spec)
    end
  end

  super
end