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
Plan shows outputs being removed when doing a target apply #26274
Comments
Thanks for reporting this, @sidprak. I've reproduced it on a current dev build of Terraform v0.14, with a slightly different configuration that avoids the need to have a working AWS account: resource "null_resource" "foo" {
}
output "queue_id" {
value = null_resource.foo.id
}
output "some_other_output" {
value = "foo"
} First I ran
Then I ran
Fortunately this plan output problem seems to just be cosmetic, because I expect this is caused by how we implemented the "Changes to outputs" part of the plan rendering so that we'd be able to include that even though Terraform 0.13 doesn't actually generate a plan for outputs in the same sense as it does for resources: Terraform implements that by capturing the full set outputs before, then calculating the plan, and then capturing the full set of outputs that resulted from the plan. Because the I expect we will not be able to fully address this at least until after some refactoring that is planned for Terraform 0.14, which will combine the refresh and plan walks together. That alone would not address this bug, but it will fix one of the constraints that blocked us from making outputs participate fully in planning (generating explicit create, update, delete actions during planning rather than merely diffing the before/after values). Once that refactoring is done we'll need to revisit that earlier decision and see if full planning of outputs is possible to implement, or if there are other blocks that might need to happen first. To avoid showing misleading information in the meantime, we could potentially disable the "Changes to outputs" part of the plan rendering when targeting is in effect, knowing that the assumptions we make to generate those indications are violated by the |
@apparentlymart thanks so much for the detailed explanation! |
I have confirmed the new handling for planned output changes has taken care of this issue in 0.14. Thanks! |
To be clear, is this a deficiency just in the display of the command? Or are the actual outputs (like use in a terraform remote state) removed? |
Just the display as @apparentlymart described above. |
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
Expected Behavior
The plan should not show that it is removing other outputs. They are not actually being removed from the state file.
Actual Behavior
Steps to Reproduce
terraform init
terraform apply -target=aws_sqs_queue.default
The text was updated successfully, but these errors were encountered: