Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/command/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"

"github.com/hashicorp/terraform/internal/backend/backendrun"
"github.com/hashicorp/terraform/internal/backend/local"
"github.com/hashicorp/terraform/internal/command/arguments"
"github.com/hashicorp/terraform/internal/command/views"
"github.com/hashicorp/terraform/internal/tfdiags"
Expand Down Expand Up @@ -78,6 +79,18 @@ func (c *PlanCommand) Run(rawArgs []string) int {
return 1
}

if len(args.Operation.ActionTargets) > 0 {
if _, ok := be.(*local.Local); !ok {
// Temporarily block invoking actions when executing anything other
// than locally.
// TODO: Remove this when TFC supports remote operation of action
// invoke plans.
diags = diags.Append(tfdiags.Sourceless(tfdiags.Error, "Invalid argument", "The -invoke argument can currently only be used when Terraform is executing locally."))
view.Diagnostics(diags)
return 1
}
}

// Build the operation request
opReq, opDiags := c.OperationRequest(be, view, args.ViewType, args.Operation, args.OutPath, args.GenerateConfigPath)
diags = diags.Append(opDiags)
Expand Down