-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External data source can't depend on resource #16762
Comments
Hi @Sebmaster, Thanks for filing this with an excellent example. The behavior here is the confluence of a couple issues. The evaluation of These are known issues that we hope to be tackling soon, however I'll keep this open for now as I don't think we have an example posted of how these dependent data sources interact. |
Hi all, I bumped into this issue yesterday. There still seems to be an issue with this. Anyone currently working on this? Otherwise I might have try, but I have never looked at terraform code yet. So some pointers on where to look would be appreciated. |
Hi @stijndehaes, I've confirmed that this is working in the current master branch. This should work in most cases with the latest 0.11 release as well, as long as you access the result map attributes with via an index:
|
Work around terraform not handling data attributes with resource inputs. See hashicorp/terraform#16762
Thanks! This saved my day on another workaround I was working on( #6884 ). |
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. |
Terraform Version
Terraform Configuration Files
(kinda convoluted to reduce it as much as possible.)
Changing any of the dependencies makes plan run successfully.
Debug Output
https://gist.github.com/Sebmaster/71dc67a935e1d58cd10ac74f2bf45cfc
Expected Behavior
According to the docs, data sources should wait until their dependencies are evaluated to run themselves.
Actual Behavior
Produces:
It seems like the ignition config is evaluating even though it shouldn't (because it needs to wait for the external script, which depends on the resource, so should only be run in the apply phase). The external source is not evaluated (as expected).
Steps to Reproduce
terraform init
terraform apply
Important Factoids
None
References
The text was updated successfully, but these errors were encountered: