diff --git a/internal/provider/resource_tfe_workspace.go b/internal/provider/resource_tfe_workspace.go index 435d15ed4..f9a047edf 100644 --- a/internal/provider/resource_tfe_workspace.go +++ b/internal/provider/resource_tfe_workspace.go @@ -903,9 +903,9 @@ func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error { if executionModeSet { executionModeIsAgent := executionMode.AsString() == "agent" if executionModeIsAgent && !agentPoolIDSet { - return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id") - } else if !executionModeIsAgent && agentPoolIDSet { return fmt.Errorf("agent_pool_id must be provided when execution_mode is 'agent'") + } else if !executionModeIsAgent && agentPoolIDSet { + return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id") } }