-
Notifications
You must be signed in to change notification settings - Fork 41
/
main.tf
45 lines (38 loc) · 1.13 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
resource "simple_resource" "a_resource_with_foreach_map" {
for_each = {
cruel: "world"
good: "class"
}
input_one = "Hello ${each.key} ${each.value}"
input_two = 0
}
output "some_output_a" {
value = simple_resource.a_resource_with_foreach_map["cruel"].result
}
data "simple_data_source" "a_data_source_with_foreach_map" {
for_each = {
cruel: "world"
good: "class"
}
input_one = "Hello ${each.key} ${each.value}"
input_two = true
}
output "some_output_b" {
value = data.simple_data_source.a_data_source_with_foreach_map["cruel"].result
}
resource "simple_resource" "a_resource_with_foreach_array" {
for_each = ["cruel", "good"]
input_one = "Hello ${each.value} world"
input_two = true
}
output "some_output_c" {
value = simple_resource.a_resource_with_foreach_array["good"].result
}
data "simple_data_source" "a_data_source_with_foreach_array" {
for_each = ["cruel", "good"]
input_one = "Hello ${each.value} world"
input_two = true
}
output "some_output_d" {
value = data.simple_data_source.a_data_source_with_foreach_array["good"].result
}