Merge pull request #11581 from hashicorp/sethvargo/output_error

Update error message when no outputs are defined
This commit is contained in:
Mitchell Hashimoto 2017-01-31 15:51:29 -08:00 committed by GitHub
commit bd5a5b0b29
1 changed files with 7 additions and 4 deletions

View File

@ -76,10 +76,13 @@ func (c *OutputCommand) Run(args []string) int {
}
if state.Empty() || len(mod.Outputs) == 0 {
c.Ui.Error(fmt.Sprintf(
"The state file has no outputs defined. Define an output\n" +
"in your configuration with the `output` directive and re-run\n" +
"`terraform apply` for it to become available."))
c.Ui.Error(
"The state file either has no outputs defined, or all the defined\n" +
"outputs are empty. Please define an output in your configuration\n" +
"with the `output` keyword and run `terraform refresh` for it to\n" +
"become available. If you are using interpolation, please verify\n" +
"the interpolated value is not empty. You can use the \n" +
"`terraform console` command to assist.")
return 1
}