diff --git a/internal/backend/backend.go b/internal/backend/backend.go index caac42cc67..d8b28b9435 100644 --- a/internal/backend/backend.go +++ b/internal/backend/backend.go @@ -249,7 +249,6 @@ type Operation struct { // behavior of the operation. PlanMode plans.Mode AutoApprove bool - Parallelism int Targets []addrs.Targetable ForceReplace []addrs.AbsResourceInstance Variables map[string]UnparsedVariableValue diff --git a/internal/backend/remote/backend_apply.go b/internal/backend/remote/backend_apply.go index 2ec123d30a..ef89466a23 100644 --- a/internal/backend/remote/backend_apply.go +++ b/internal/backend/remote/backend_apply.go @@ -42,7 +42,7 @@ func (b *Remote) opApply(stopCtx, cancelCtx context.Context, op *backend.Operati return nil, diags.Err() } - if op.Parallelism != defaultParallelism { + if b.ContextOpts != nil && b.ContextOpts.Parallelism != defaultParallelism { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, "Custom parallelism values are currently not supported", diff --git a/internal/backend/remote/backend_apply_test.go b/internal/backend/remote/backend_apply_test.go index d549145597..4bc2a909f2 100644 --- a/internal/backend/remote/backend_apply_test.go +++ b/internal/backend/remote/backend_apply_test.go @@ -46,7 +46,6 @@ func testOperationApplyWithTimeout(t *testing.T, configDir string, timeout time. return &backend.Operation{ ConfigDir: configDir, ConfigLoader: configLoader, - Parallelism: defaultParallelism, PlanRefresh: true, StateLocker: clistate.NewLocker(timeout, stateLockerView), Type: backend.OperationTypeApply, @@ -223,7 +222,10 @@ func TestRemote_applyWithParallelism(t *testing.T) { op, configCleanup, done := testOperationApply(t, "./testdata/apply") defer configCleanup() - op.Parallelism = 3 + if b.ContextOpts == nil { + b.ContextOpts = &terraform.ContextOpts{} + } + b.ContextOpts.Parallelism = 3 op.Workspace = backend.DefaultStateName run, err := b.Operation(context.Background(), op) diff --git a/internal/backend/remote/backend_plan.go b/internal/backend/remote/backend_plan.go index 82f33ec2dc..736c040b4d 100644 --- a/internal/backend/remote/backend_plan.go +++ b/internal/backend/remote/backend_plan.go @@ -38,7 +38,7 @@ func (b *Remote) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operatio return nil, diags.Err() } - if op.Parallelism != defaultParallelism { + if b.ContextOpts != nil && b.ContextOpts.Parallelism != defaultParallelism { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, "Custom parallelism values are currently not supported", diff --git a/internal/backend/remote/backend_plan_test.go b/internal/backend/remote/backend_plan_test.go index a231f149ec..6d4ced7b87 100644 --- a/internal/backend/remote/backend_plan_test.go +++ b/internal/backend/remote/backend_plan_test.go @@ -44,7 +44,6 @@ func testOperationPlanWithTimeout(t *testing.T, configDir string, timeout time.D return &backend.Operation{ ConfigDir: configDir, ConfigLoader: configLoader, - Parallelism: defaultParallelism, PlanRefresh: true, StateLocker: clistate.NewLocker(timeout, stateLockerView), Type: backend.OperationTypePlan, @@ -198,7 +197,10 @@ func TestRemote_planWithParallelism(t *testing.T) { op, configCleanup, done := testOperationPlan(t, "./testdata/plan") defer configCleanup() - op.Parallelism = 3 + if b.ContextOpts == nil { + b.ContextOpts = &terraform.ContextOpts{} + } + b.ContextOpts.Parallelism = 3 op.Workspace = backend.DefaultStateName run, err := b.Operation(context.Background(), op) diff --git a/internal/command/meta_backend.go b/internal/command/meta_backend.go index 71ebfbe262..82ecd89c78 100644 --- a/internal/command/meta_backend.go +++ b/internal/command/meta_backend.go @@ -349,7 +349,6 @@ func (m *Meta) Operation(b backend.Backend) *backend.Operation { return &backend.Operation{ PlanOutBackend: planOutBackend, - Parallelism: m.parallelism, Targets: m.targets, UIIn: m.UIInput(), UIOut: m.Ui,