Difference between revisions of "Terraform types"

From wikieduonline
Jump to navigation Jump to search
Line 6: Line 6:
 
* <code>number</code>: a numeric value. The number type can represent both whole numbers like 15 and fractional values like 6.283185.
 
* <code>number</code>: a numeric value. The number type can represent both whole numbers like 15 and fractional values like 6.283185.
 
* <code>bool</code>: a boolean value, either true or false. bool values can be used in conditional logic.
 
* <code>bool</code>: a boolean value, either true or false. bool values can be used in conditional logic.
* <code>[[list]]</code> (or tuple): a sequence of values, like ["us-west-1a", "us-west-1c"]. Elements in a list or tuple are identified by consecutive whole numbers, starting with zero.
+
* <code>[[list]]</code> or [[tuple]]: a sequence of values, like ["us-west-1a", "us-west-1c"]. Elements in a list or tuple are identified by consecutive whole numbers, starting with zero.
* <code>[[map]]</code> (or object): a group of values identified by named labels, like {name = "Mabel", age = 52}.
+
* <code>[[map]]</code> or <code>object</code>: a group of values identified by named labels, like {name = "Mabel", age = 52}.
  
 
Example:
 
Example:
Line 15: Line 15:
 
List example: <code> ["us-west-1a", "us-west-1c"]</code>
 
List example: <code> ["us-west-1a", "us-west-1c"]</code>
  
 +
 +
Map/Object example:
 +
<pre>
 +
{
 +
  name = "John"
 +
  age  = 52
 +
}
 +
</pre>
 
== Related terms ==
 
== Related terms ==
 
* [[variable]]
 
* [[variable]]

Revision as of 10:59, 8 September 2021


  • string: a sequence of Unicode characters representing some text, like "hello".
  • number: a numeric value. The number type can represent both whole numbers like 15 and fractional values like 6.283185.
  • bool: a boolean value, either true or false. bool values can be used in conditional logic.
  • list or tuple: a sequence of values, like ["us-west-1a", "us-west-1c"]. Elements in a list or tuple are identified by consecutive whole numbers, starting with zero.
  • map or object: a group of values identified by named labels, like {name = "Mabel", age = 52}.

Example:

 type        = list(string)
 default     = []

List example: ["us-west-1a", "us-west-1c"]


Map/Object example:

{
  name = "John"
  age  = 52
}

Related terms

See also

Advertising: