How to make a voltage controlled adjustable resistor?
A "digital potentiometer" may help you. Its input is digital, generally I2C, so you can drive it directly with the microprocessor. You can find them in stores like Digikey, Mouser and so on...

If you are looking for an analog solution, then you could use use a MOSFET in triode operating region, or a voltage controlled current source. But this solutions may take more design time, specially if you want to connect them as a two-terminal device, which I interpret from your question .