Usually the replacement type LED bulbs (many LEDs per bulb unit) are designed to divide the 12 volts across each of them to achieve the correct voltage on each individual LED (~ 1.9-3.6 volts usually). The bulbs have a couple rows of 3 or 4 LEDs in series (12v / 4 = 3 volts) bunched together.
So assuming a 12-volt power source and a white LED with the desired current of 10 mA; The formula becomes Resistor = (12-3.4)/.010 which is 860 ohms. Since this is not a standard value I would use an 820-ohm resistor. We also need to determine the power rating (watts) of the required resistor.
The new LEDs are simply ON/OFF and have 2 wires. Since LEDs do not draw as much power as the stock filament bulbs, load resistors (that come with the LEDs) are included. These resistors get very hot because they pass a lot of current so the electronics on the motorcycle will not think there is a burnt bulb.
The main reason LEDs need resistors is to protect the LED from excessive current which can permanently damage the LED. LEDs have current ratings which indicate the optimal current at which the LED operates effectively.
.