-
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
Remove error on empty outputs when -json
is set
#11721
Conversation
- Fixes hashicorp#11696 - This changes makes `terraform output -json` return '{}' instead of throwing an error about "no outputs defined" - If `-json` is not set, the user will receive an error as before - This UX helps new users to understand how outputs are used - Allows for easier automation of TF CLI as an empty set of outputs is usually acceptable, but any other error from `output` would be re-raised to the user.
@paddyforan gentle bump on getting this merged before I completely forget about it :) |
Hi @ljfranklin! I am, unfortunately, probably the wrong person to look at this issue; we all just help triage them so the right people can find them. The good news is now that it's labeled, when the right people have time, they'll be able to find the issue pretty easily. Sorry for the delays! |
We ran into this today. Is there anything stopping this from being merged? |
- When there are no outputs: hashicorp/terraform#11721 [#152866137] Signed-off-by: Genevieve LEsperance <[email protected]>
- When there are no outputs: hashicorp/terraform#11721 [#152866137] Signed-off-by: Genevieve LEsperance <[email protected]>
Hi @ljfranklin, and @genevievelesperance! Sorry that this one apparently fell through the cracks. It looks like a good change so I'll make a note to look at it again once we're out of the 0.11.0 release freeze period. (We keep this active for a few days after the release in case any bug fixes are required.) |
Awesome! Thank you. |
- When there are no outputs: hashicorp/terraform#11721 [#152866137] Signed-off-by: Genevieve LEsperance <[email protected]>
Any updates on this? We are having the same issue. |
Hi @ljfranklin and @genevieve , |
- Fixes hashicorp#11696 - This changes makes `terraform output -json` return '{}' instead of throwing an error about "no outputs defined" - If `-json` is not set, the user will receive an error as before - This UX helps new users to understand how outputs are used - Allows for easier automation of TF CLI as an empty set of outputs is usually acceptable, but any other error from `output` would be re-raised to the user.
- Fixes hashicorp#11696 - This changes makes `terraform output -json` return '{}' instead of throwing an error about "no outputs defined" - If `-json` is not set, the user will receive an error as before - This UX helps new users to understand how outputs are used - Allows for easier automation of TF CLI as an empty set of outputs is usually acceptable, but any other error from `output` would be re-raised to the user.
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 output -json
return '{}' instead ofthrowing an error about "no outputs defined"
-json
is not set, the user will receive an error as beforeusually acceptable, but any other error from
output
would bere-raised to the user.