From a80c7853258e3b72b4a1b2c4d61de57766cc5719 Mon Sep 17 00:00:00 2001 From: "Edwin.Avalos" Date: Fri, 23 Dec 2016 18:00:20 -0600 Subject: [PATCH] Implement validate command Credit to @ewbankkit for the original code. I found it worthwhile to take revive the PR off the current master --- plugin.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin.go b/plugin.go index 3ad641b..b90d39e 100644 --- a/plugin.go +++ b/plugin.go @@ -58,6 +58,7 @@ func (p Plugin) Exec() error { commands = append(commands, remoteConfigCommand(remote)) } commands = append(commands, getModules()) + commands = append(commands, validateCommand()) commands = append(commands, planCommand(p.Config.Vars, p.Config.Secrets, p.Config.Parallelism, p.Config.Targets)) if !p.Config.Plan { commands = append(commands, applyCommand(p.Config.Parallelism, p.Config.Targets)) @@ -135,6 +136,16 @@ func getModules() *exec.Cmd { ) } +func validateCommand() *exec.Cmd { + args := []string{ + "validate", + } + return exec.Command( + "terraform", + args..., + ) +} + func planCommand(variables map[string]string, secrets map[string]string, parallelism int, targets []string) *exec.Cmd { args := []string{ "plan",