cli: Fix missing apply summary for remote runs

Disabling the resource count and outputs rendering when the remote
backend is in use causes them to be omitted from Terraform Cloud runs.
This commit changes the condition to render these values if either the
remote backend is not in use, or the command is running in automation
via the TF_IN_AUTOMATION flag. As this is intended to be set by
Terraform Cloud and other remote backend implementations, this addresses
the problem.
pull/28412/head
Alisdair McDiarmid 5 years ago
parent 23800438ab
commit 69e7922a33

@ -123,8 +123,8 @@ func (c *ApplyCommand) Run(rawArgs []string) int {
}
// Render the resource count and outputs, unless we're using the remote
// backend, in which case these are rendered remotely
if _, isRemoteBackend := be.(*remoteBackend.Remote); !isRemoteBackend {
// backend locally, in which case these are rendered remotely
if _, isRemoteBackend := be.(*remoteBackend.Remote); !isRemoteBackend || c.RunningInAutomation {
view.ResourceCount(args.State.StateOutPath)
if !c.Destroy && op.State != nil {
view.Outputs(op.State.RootModule().OutputValues)

Loading…
Cancel
Save