Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 601 Bytes

pass-variables-to-terraform.md

File metadata and controls

27 lines (19 loc) · 601 Bytes

Pass Variables To Terraform

Category: Terraform

Variables can be passed to Terraform from the command line using the -var parameter.

Assume a variables.tf file:

variable "environment_name" {
  type = string
  description = "The name of the environment."
}


variable "location" {
  type = string
  description = "The Azure region where the resources will be created. The default is westeurope."
  default = "westeurope"
}

Assume you want to specify a value for environment_name which does not have a default:

terraform plan -var environment_name="dev"