I have a variables.tf file which contains all the project variables and im trying to fetch a variable values using PowerShell.
variables.tf
variable "products" {
default = [
"Product-1",
"Product-2",
"Product-3",
"Product-4"
]
}
variable "product_unified_container" {
default = [
"cont-data",
"cont-data-2"
]
}
variable "location" {
default = "westeurope"
}
Using PowerShell i need to be able to fetch the variable values for any variable I want.
Example : the command should give me a array of all the products variables in variables.tf if it has multiple values.
write-host $product_list
Product-1
Product-2
Product-3
Product-4
if the variable has one value then it should give me that value like "location" variable.
write-host $deployed_location
westeurope
