-
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
Outputs are not removed from state #13555
Comments
Thanks for this, @sethvargo. I think this has the same root cause as #12572 and #11716, which is that outputs are only updated when their graph nodes are visited during apply. All of these tickets are various reasons why the apply step of an output wouldn't be run. In this case, it's because the If that's true, then a targeted fix for this would be to make sure the outputs get evaluated during the refresh walk too. The more comprehensive fix would be something like what I suggested in a comment in #11716: update outputs immediately whenever any of their dependencies change, rather than waiting until their graph nodes are visited. |
@apparentlymart, I made an attempt at solving the related issue that outputs don't generate errors, but it turned out to be a larger problem than anticipated. I think the solution to that is to promote outputs to be (or act like) an actual resource, where they are graph nodes that we can properly order, and destroy, which will in turn solve this issue. |
@apparentlymart @jbardin Just curious when you think this will be included into a future release? |
There are no firm plans yet, since addressing this family of output-not-updating issues is likely to require a change in approach for outputs. We have had some initial discussion about different alternatives but it will take some iterations to settle on something that works well with the rest of the system while achieving these goals. |
@apparentlymart Thanks for the update. If there is some way I can help test any updates please let me know. We rely on outputs heavily for our infrastructure. |
As a workaround I am using the following method
|
This is fixed in master via #16599, and will be in the 0.11.0 release. |
I'm running into this in 0.11.7, could it be a different bug? In my base module, I rename an output and all previous names persist when doing |
@jeffmccune, the outputs are only written during an |
It would be nice if |
I can confirm this issue still with Terraform v0.11.13
I am not running |
confirmed this is still an issue in 11.14 and 12.0 |
I switched from using |
@jbardin Is there a reasoning behind it? (I have run into it with 0.12.0 which led me to this issue.) |
@a13xb Using 0.12.0: Note: This seems to work when adding new outputs from existing applied plans. |
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
0.9.2
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
After adding an output and running
terraform refresh
, removing the output and runningterraform refresh
, there should be no outputs.Actual Behavior
After removing the output and refreshing, the output is still cached in the state and queryable.
Steps to Reproduce
terraform refresh
terraform refresh
Important Factoids
This appears to be a regression.
The text was updated successfully, but these errors were encountered: