Terraform variables: variables.tf

From wikieduonline
(Redirected from Terraform: variables.tf)
Jump to navigation Jump to search

Example variable declaration[edit]

Definition in variables.tf

variable "YourVarName" {}
variable "YourVarName" { default = "your_default_value" }
variable "your_subnets" { default = ["subnet-0d68d399b6cf9c2b3", "subnet-055f2f0b4de211111"] }
variable "YourVarName" {
  default = "your_default_value"
}
variable "YourVarName" {
  type = string
  description = "Description of your variable"
  default = "your_default_value"
}

Usage in any terraform file (main.tf), using var. prefix:

AnyFieldToAssingAValue = var.YourVarName

Errors[edit]

Related term[edit]

See also[edit]

Advertising: