Module: Pangea::Resources::Helpers
- Defined in:
- lib/pangea/resources/helpers.rb
Overview
Helper functions available in template context
Instance Method Summary collapse
-
#data_ref(data_type, data_name, attribute) ⇒ String
Create a data source reference.
-
#local(local_name) ⇒ String
Create a local value reference.
-
#ref(resource_type, resource_name, attribute) ⇒ String
Create a terraform reference to another resource.
-
#var(var_name) ⇒ String
Create a variable reference.
Instance Method Details
#data_ref(data_type, data_name, attribute) ⇒ String
Create a data source reference
35 36 37 |
# File 'lib/pangea/resources/helpers.rb', line 35 def data_ref(data_type, data_name, attribute) "${data.#{data_type}.#{data_name}.#{attribute}}" end |
#local(local_name) ⇒ String
Create a local value reference
49 50 51 |
# File 'lib/pangea/resources/helpers.rb', line 49 def local(local_name) "${local.#{local_name}}" end |
#ref(resource_type, resource_name, attribute) ⇒ String
Create a terraform reference to another resource
26 27 28 |
# File 'lib/pangea/resources/helpers.rb', line 26 def ref(resource_type, resource_name, attribute) "${#{resource_type}.#{resource_name}.#{attribute}}" end |
#var(var_name) ⇒ String
Create a variable reference
42 43 44 |
# File 'lib/pangea/resources/helpers.rb', line 42 def var(var_name) "${var.#{var_name}}" end |