mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-18 20:52:58 -06:00
f3a1f1a263
* command/console: allow use of impure functions in terraform console * add tests for Context Eval
40 lines
555 B
HCL
40 lines
555 B
HCL
variable "number" {
|
|
default = 3
|
|
}
|
|
|
|
variable "string" {
|
|
default = "Hello, World"
|
|
}
|
|
|
|
variable "map" {
|
|
type = map(string)
|
|
default = {
|
|
"foo" = "bar",
|
|
"baz" = "bat",
|
|
}
|
|
}
|
|
|
|
locals {
|
|
result = length(var.list)
|
|
}
|
|
|
|
variable "list" {
|
|
type = list(string)
|
|
default = ["red", "orange", "yellow", "green", "blue", "purple"]
|
|
}
|
|
|
|
resource "test_resource" "example" {
|
|
for_each = var.map
|
|
name = each.key
|
|
tag = each.value
|
|
}
|
|
|
|
module "child" {
|
|
source = "./child"
|
|
list = var.list
|
|
}
|
|
|
|
output "result" {
|
|
value = module.child.result
|
|
}
|