class GeoEngineer::Provider

Outputs are mapped 1:1 to terraform outputs

{www.terraform.io/docs/providers/aws/ Terraform Docs}

Attributes

id[R]

Public Class Methods

new(id, &block) click to toggle source
# File lib/geoengineer/provider.rb, line 10
def initialize(id, &block)
  @id = id
  instance_exec(self, &block) if block_given?
end

Public Instance Methods

terraform_id() click to toggle source
# File lib/geoengineer/provider.rb, line 15
def terraform_id
  if self.alias
    "#{id}.#{self.alias}"
  else
    id
  end
end
to_terraform() click to toggle source

Terraform methods

# File lib/geoengineer/provider.rb, line 24
def to_terraform
  sb = ["provider #{@id.inspect} { "]

  sb.concat terraform_attributes.map { |k, v|
    "  #{k.to_s.inspect} = #{v.inspect}"
  }

  sb << " }"
  sb.join("\n")
end
to_terraform_json() click to toggle source
# File lib/geoengineer/provider.rb, line 35
def to_terraform_json
  { id.to_s => terraform_attributes }
end