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

From wikieduonline
Jump to navigation Jump to search
Line 7: Line 7:
  
 
Definition in <code>[[variables.tf]]</code>
 
Definition in <code>[[variables.tf]]</code>
  variable "yourvarname" {
+
  variable "YourVarName" {
 
   default = "your_default_value"
 
   default = "your_default_value"
 
  }
 
  }
  
  variable "yourvarname" {
+
  variable "YourVarName" {
 
   type = string
 
   type = string
 
   description = "Description of your variable"
 
   description = "Description of your variable"
Line 18: Line 18:
  
 
Usage in <code>[[main.tf]]</code>
 
Usage in <code>[[main.tf]]</code>
  AnyFieldToAssingAValue = [[var.]]yourvarname
+
  AnyFieldToAssingAValue = [[var.]]YourVarName
  
 
== Related term ==
 
== Related term ==

Revision as of 09:59, 5 September 2021

Example

Definition in variables.tf

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

Related term

See also

Advertising: