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

From wikieduonline
Jump to navigation Jump to search
Line 15: Line 15:
  
 
  variable "YourVarName" {
 
  variable "YourVarName" {
   type = string
+
   [[type]] = string
 
   description = "Description of your variable"
 
   description = "Description of your variable"
 
   default = "your_default_value"
 
   default = "your_default_value"

Revision as of 19:29, 6 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

Related term

See also

Advertising: