-
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
Output
does not not show module outputs
#1940
Comments
Well, one bug is that outputs shouldn't be able to have spaces. So let's fix that up (and you should too!) But we should support this, tagged. |
👍 |
👍 Would be great to get this in |
On CentOS 7.2, Terraform v0.7.6 with this config:
I get the following even after running "terraform apply":
It turns out that the output is not printed even during "terraform apply" too. Should it behave like that ? Regards, |
facing same issue - was there any resolution to this? |
@ddimri only way what I found were that you need to "pipe" the output from module down in the hierarchy. So take the output of module and pass forward to new output. |
Indeed, re-exporting the value from the top-level (root) module is the best way to do this right now. Generally Terraform thinks of nested modules as being implementation details of the root module and won't expose them, though of course we can potentially do this here as a convenience. In the mean time, doing something like this in the root module would be my suggestion:
Then you can retrieve it from the command line like this:
|
It seems re-exporting is no longer necessary with "version": 3.
terraform.tfstate:
|
Just run into it. Apparently in terraform version 0.12 you need to reexport outputs.
|
Hi all, Indeed, in prior versions of Terraform the module outputs would end up in the serialized state snapshots as a side-effect of how Terraform tracked these internally, but Terraform 0.12 now handles them in a different way and so only the root module outputs appear in state snapshots. Child module outputs now exist only temporarily in memory, due to them now being implemented consistently with input variables and local values. The CLI layer (of which Any data that you wish to access from outside of the Terraform configuration itself must be explicitly exported with an Since the data in question is intentionally no longer in the state snapshots, we're going to close this now. Sorry for the long silence here, and for the confusing accidental fixing and breaking of this feature along the way. |
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. |
Hey all,
I've got a state that looks something like this - just a single module with all my resources and an output defined within:
terraform.tfstate:
I'm trying to access the output within the module, but I keep getting told that the state file has no outputs defined. (Presumably this line?)
Is this something that there are plans to support? e.g. like
taint -module=path resource
Or is there another way to get an output (e.g. ec2 public dns) from a module?
Thanks,
The text was updated successfully, but these errors were encountered: