Given below is list_demo.tf file and list_output.tf file
cat list_demo.tf
variable "list_example" {
description="demo on list data type"
type=list(string)
#default=["Aniket Pant","42","true"]
}
[root@localhost list]# cat list_output.tf
output "list_output" {
value=var.list_example
}
While running terraform plan command it has to give error as list can accept same data type
[root@localhost list]# terraform plan
var.list_example
demo on list data type
Enter a value: ["Aniket",28,true]
Changes to Outputs:
+ list_output = [
+ "Aniket",
+ "28",
+ "true",
]
You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.
I want to understand the behaviour of terraform , is it converting into string ?
Earlier i was using this below file and the input was same and got the same output as i mentioned in above. If i am not providing any type in list , what is the default type ?
cat list_demo.tf
variable "list_example" {
description="demo on list data type"
type=list
#default=["Aniket Pant","42","true"]
}
Please do share the documentation as i am learning.