mirror of
https://github.com/hashicorp/terraform.git
synced 2026-06-09 00:42:48 -04:00
Because expression from JSON files are handled differently from HCL, we need to deal with these manually when evaluating the special "to" syntax. We take the same approach as was done for replace_triggered_by, where the raw string is extracted from the json expression, and re-evaluated as an HCL expression.
14 lines
238 B
JSON
14 lines
238 B
JSON
{
|
|
"import": {
|
|
"for_each": "[\"a\", \"b\"]",
|
|
"to": "test_resource.test[each.value]",
|
|
"id": "${each.value}"
|
|
},
|
|
"resource": {
|
|
"test_resource": {
|
|
"test": {
|
|
"for_each": {"a":"a","b":"b"}
|
|
}
|
|
}
|
|
}
|
|
}
|