command: Make input variable values available to "terraform console"

This fixes TestConsole_tfvars.
This commit is contained in:
Martin Atkins 2018-10-13 08:07:58 -07:00
parent 741d334ee4
commit 74582447bb
1 changed files with 9 additions and 0 deletions

View File

@ -74,6 +74,15 @@ func (c *ConsoleCommand) Run(args []string) int {
c.showDiagnostics(diags) c.showDiagnostics(diags)
return 1 return 1
} }
{
var moreDiags tfdiags.Diagnostics
opReq.Variables, moreDiags = c.collectVariableValues()
diags = diags.Append(moreDiags)
if moreDiags.HasErrors() {
c.showDiagnostics(diags)
return 1
}
}
// Get the context // Get the context
ctx, _, ctxDiags := local.Context(opReq) ctx, _, ctxDiags := local.Context(opReq)