Difference between revisions of "Terraform variables: variables.tf"

From wikieduonline
Jump to navigation Jump to search
Line 22: Line 22:
 
Usage in <code>[[main.tf]]</code>
 
Usage in <code>[[main.tf]]</code>
 
<code>AnyFieldToAssingAValue = [[var.]]YourVarName</code>
 
<code>AnyFieldToAssingAValue = [[var.]]YourVarName</code>
 +
 +
== Errors ==
 +
* [[Error: No value for required variable]]
  
 
== Related term ==
 
== Related term ==

Revision as of 12:36, 20 September 2021

Example

Definition in variables.tf

variable "YourVarName" { default = "your_default_value" }

variable "YourVarName" {
  default = "your_default_value"
}
variable "YourVarName" {
  type = string
  description = "Description of your variable"
  default = "your_default_value"
}

Usage in main.tf AnyFieldToAssingAValue = var.YourVarName

Errors

Related term

See also

Advertising: