Skip to content

Commit 058f0ca

Browse files
committed
Fix inconsistent plan error
This is a temprorary(?)/partial(?) fix for the inconsistent plan error. As part of creating the examples for (#203) I was running into this issue and noticed that all of the occurrences were due to the `terraform_data` resources changing from `null` to `""`. Adding this simple `try` function to always fallback to `""` seems to have fixed the issue in a lot of cases. This obviously doesn't fix the inconsistent plan issue in all cases, but it gets us unstuck for creating example tests. re #198
1 parent 089d6a9 commit 058f0ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/tfsandbox/tf_file.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func CreateTFFile(
214214

215215
resourceName := fmt.Sprintf("%s%s", terraformDataResourcePrefix, output.Name)
216216
resources[terraformDataResourceType][resourceName] = map[string]interface{}{
217-
"input": fmt.Sprintf("${module.%s.%s}", name, output.Name),
217+
"input": fmt.Sprintf("${try(module.%s.%s, \"\")}", name, output.Name),
218218
}
219219
}
220220

0 commit comments

Comments
 (0)