-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Make lifecycle information available to the code #32025
Comments
Hi @Nuru, I think this is more or less a feature request for the provider framework. This information is generally discernible via the plugin protocol, but perhaps there are some situations which are not clear from perspective of the framework API? Do you have an example where a change on the core side of the protocol would help? Thanks! |
Reading the issue again, I think I might have misunderstood your request, and are asking for this type of information to be available within the configuration. The example here is unusual, because it's trying to use a managed resource and data source to represent the same remote object, which is almost always a mistake. The problems with attempting to read information about a resource during plan and changing that resource during apply are not going to go away. You also have a dependency cycle between the managed resource and the data source, so there is no defined order of operations which can resolve the data. Issue #16380 is something that must be implemented by the provider, because it is only the provider that can differentiate between various error conditions in the remote API. Issue #32023 is something we need to look into further. The Thanks! |
Since we have not heard back in a while I'm going to close the issue. There doesn't appear to be anything actionable in Terraform core here, but If you have any updates regarding the issue, feel free to open a new issue with the requested information. If you have more questions, you can also use the community forum where there are more people ready to help. Thanks! |
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. |
Terraform Version
Use Cases
It would be helpful when working around issues like #32023 or #16380 or other situations that crop up to be able for the code to know the state and state change of a resource during an update. Is it being created? Does it already exist? Is it being destroyed?
Attempted Solutions
One can use the
time_sleep
resource to specify different durations for creation and deletion and combine withtime_offset
to try to deduce the lifecycle phase, but that is quite a hack.Another workaround is to create a duplicate dummy resource to ensure the data source has something to read before the real resources is created.
Proposal
Add a way to query the lifecycle of a resource. Perhaps add a read-only attribute such as lifecycle that returns a list or set of things happening to the resource in the plan. One or more of
So then I can do something like
References
The text was updated successfully, but these errors were encountered: