You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplest example I could come up with to illustrate the problem. Note if you move the python code to it's own file the result will be the same. The external datasource will not be executed but the output's depending on the datasource will fail validation. https://gist.github.com/JBirdVegas/9e508d2ce4266fd7c242c3f080f5368f
Output variable should be populated after external datasource can be evaluated
Actual Behavior
Terraform appears to attempt to validate the output variable before evaluating the external datasource that should be a parent module
Steps to Reproduce
$ terraform init
$ terraform plan
Important Factoids
Seems like this kinda thing should have first turned into a warning before terraform started breaking deployments with no way of going back to a previously working version of terraform.
Edit:
Reported remedies do not work for this provider. Example adding the following the the script provided
output "result_of_python_test" {
value = "${join("", data.external.test_python.result.*.status)}"
}
output "result_of_python_test_2" {
value = "${join("", data.external.test_python.*.result.*.status)}"
}
output "result_of_python_test_3" {
value = "${join("", data.external.test_python.*.result.status)}"
}
will return these errors:
Error: Error running plan: 3 error(s) occurred:
* output.result_of_python_test_2: Resource 'data.external.test_python' does not have attribute 'result.*.status' for variable 'data.external.test_python.*.result.*.status'
* output.result_of_python_test: Resource 'data.external.test_python' does not have attribute 'result.*.status' for variable 'data.external.test_python.result.*.status'
* output.result_of_python_test_3: Resource 'data.external.test_python' does not have attribute 'result.status' for variable 'data.external.test_python.*.result.status'
References
The text was updated successfully, but these errors were encountered:
While this particular instance would have been hidden by the silent output errors, this is a slightly different case as it wouldn't be valid anywhere in the config. The depends_on in the data source is forcing it to not be evaluated in time for the interpolation.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 6, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
After upgrading to 0.11 we started having deployments fail.
When the result of an external data source is used to populate an output variable terraform fails.
Terraform Version
Terraform Configuration Files
Simplest example I could come up with to illustrate the problem. Note if you move the python code to it's own file the result will be the same. The external datasource will not be executed but the output's depending on the datasource will fail validation.
https://gist.github.com/JBirdVegas/9e508d2ce4266fd7c242c3f080f5368f
Debug Output
https://gist.github.com/JBirdVegas/97d8fc110a353c6db6b199eae655714b
Expected Behavior
Output variable should be populated after external datasource can be evaluated
Actual Behavior
Terraform appears to attempt to validate the output variable before evaluating the external datasource that should be a parent module
Steps to Reproduce
Important Factoids
Seems like this kinda thing should have first turned into a warning before terraform started breaking deployments with no way of going back to a previously working version of terraform.
Edit:
Reported remedies do not work for this provider. Example adding the following the the script provided
will return these errors:
References
The text was updated successfully, but these errors were encountered: