-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Terraform Console Unable to Output Module Outputs #21516
Comments
Thanks for reporting this, @jvasallo. The intended design here is that I have a different theory to check first, though: I see you're passing a few input variables from the root module into the child module. We've seen in #21483 that |
Thanks for the quick response! The Terraform Console Output:
Seems to evaluate local outputs fine? The resource created is: resource "aws_iam_user" "example_user" {
name = "example_user"
path = "/user-example/"
} The output from the module is: output "example_output" {
value = "${aws_iam_user.example_user.arn}"
} If we feel this is related to #21483 let me know. Sorry if this is a duplicate issue. :) |
Thanks for sharing that additional context, @jvasallo. Indeed it does seem like this is a separate problem, so we'll keep it as a separate issue for now until we can investigate further and understand what's going on here. The intended behavior is that |
Any news on this bug? It makes it very hard to create modules that "bake" configuration. If I want to see my state, I have to either inline the code in the parent, or make the module able to stand alone, if I want to inspect the results. |
Are there any workarounds for getting outputs with 0.12 modules? Edit: Here's what I've tried so far:
2nd edit: I'm an idiot. Completely missed that the actual root tf file contained a module that referenced another module. What ended up working for me is defining an output at each module and then chaining them like so: |
You can easily reproduce this bug with the following code: Module:
Import...
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi all, Please do not post "me too" comments here, since it creates noise for others watching the issue and ultimately doesn't influence our prioritization because we can't actually report on these. Instead, react to the original issue comment with 👍, which we can and do report on. |
Sorry for the labeling noise! After some internal discussion related to the closed PR above I wanted to make a note that |
I'm going to close this and consider it resolved because it was resolved in #24808, in order to keep the GH issue listing only showing unresolved issues. Please file a new bug and reference this one if it doesn't work for you in 0.13.0. |
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. |
After upgrading to Terraform v0.12, it appears Terraform console no longer is able to access module outputs from a remote state (or state in general). It always seems to expect a
terraform apply
to occur. Terraform operations (such as plan and apply) work fine, as well as module output references in resource blocks as well. Onlyterraform console
seems to be impacted. Not sure if this is an intended change or not.Happy to share anything I can. Looking at the TF_LOG I see it crawling ok, and it even finds references and such.
Terraform Version
Terraform Configuration Files
Standard Module Refs
Debug Output
N/A
Crash Output
N/A
Expected Behavior
terraform console
to use remote state or find terraform outputs from modules.Actual Behavior
terraform console
seems to always expectterraform apply
to occur despite it succeedingSteps to Reproduce
Go to an existing terraform project/workspace:
terraform console
> module.aws-iam-example.example_output
Error: Result depends on values that cannot be determined until after "terraform apply".
Additional Context
Upgraded from 0.11.4 to 0.12.0 recently, and post upgrade it seems to not be able to evaluate state in
terraform console
. We use a remote state in S3 and DynamoDB for Locking.References
N/A
The text was updated successfully, but these errors were encountered: