Skip to content
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

changes only to root module outputs don't produce a diff #17993

Closed
dpwspoon opened this issue May 4, 2018 · 3 comments
Closed

changes only to root module outputs don't produce a diff #17993

dpwspoon opened this issue May 4, 2018 · 3 comments

Comments

@dpwspoon
Copy link

dpwspoon commented May 4, 2018

It would be nice if adding an output variable that didn't require a rebuild was saved to remote state. I'm not sure if a proper mechanism is force rebuild, or some other implementation?? (Didn't see anything in cli or existing tickets)

Steps to Reproduce

If you update an output variable like this to terraform plan/workspace A, the plan detects that it does not need to rebuild

output "private_subnet_id" {
  value = "${aws_subnet.private_subnet.id}"
}

image

It would be nice if it reevaluated that variable and saved it in the state for downstream plan/workspaces that want to use that variable via terraform_remote_state

plan b

data "terraform_remote_state" "plan_a" {
  backend = "atlas"
  config {
    name = "dummy/plan_a"
  }
}

module "some_module {
  source = "modules/compute/instances"
  subnet_id = "${data.terraform_remote_state.plan_a.private_subnet_id}"
}

Terraform Version

Terraform v0.11.7
@jbardin jbardin changed the title Saving state when adding new terraform output variable for use in terraform_remote_state changes only to root module outputs don't produce a diff May 4, 2018
@jbardin
Copy link
Member

jbardin commented May 4, 2018

Hi @dpwspoon, thanks for filing the issue.

Terraform actually will re-evaluate the output and save it to state if you run apply. The issue here is that terraform currently doesn't produce a diff if only outputs change, and since TFE doesn't see a diff output, there is no option to apply.

Though I think this will be something we fix in Terraform OSS, feel free to file a ticket with Terraform Enterprise though the normal support channels if this is something that is blocking you.

@apparentlymart
Copy link
Contributor

I think this is the same thing that #15419 is talking about, viewed from a Terraform Enterprise lens. We're planning to do a little more design and prototyping of that once we get through our current set of work around the configuration language.

Since fixing #15419 should fix this too, I'm going to close this one just to consolidate the discussion. Thanks for opening this and describing the issue, @dpwspoon!

@ghost
Copy link

ghost commented Apr 3, 2020

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 ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants