fix: Avoids issue due to strict requirement for fileexists to return consistent results #722
+3
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In old versions of terraform, the ternary operator did not short-circuit, and so the
was_missinglogic was needed as a hack to workaround both logic paths executing on every run. The module needed the hack to avoid failing when the package existed previously vs when it did not and was being created by the module itself.In recent-ish versions of terraform, including the module min version 1.5.7, the ternary operator will shortcircuit, so it will only execute the true OR false logic, rather than both. This makes the
was_missinglogic unnecessary.Further, in most recent versions of terraform, at least since 1.13.0, the
was_missinglogic resulted in a failure when separately building the package and then attempting to use the package in the same workflow. The failure occurred because terraform became more strict at enforcing that the return values of thefileexists()function be consistent between plan and apply phases.Fixes #698
Breaking Changes
None
How Has This Been Tested?
examples/*to demonstrate and validate my change(s)examples/*projectspre-commit run -aon my pull request