It depends on what you mean by "electronic component" and "CPU". If you restrict that to semiconductor devices and the actual processing unit itself, then yes, a CPU is made of transistors.
If you include IOs, you have some higher-voltage transistors and clamp diodes, plus ESD protection cells (which can use transistors and/or diodes). If you allow passive components, you have wires made out of metal or polysilicon. Of course, diodes can be made from BJTs as well.
Transistors and wires are the only components on many integrated circuits, including many CPU chips.
Some microprocessors have other components on the same chip as the processor. If you include the whole chip, then you might have any number of analog components: diodes for temperature measurement, analog to digital converters, LDO voltage regulators, crystal oscillators, sense amplifiers for memory, and (perhaps most commonly) power-on reset circuits. These use passive components. Resistors are the most common, and come in many different types:
- Polysilicon - Low resistance, okay tolerance, also used for wires
- N-well - High resistance, terrible tolerance and tempco
- Diffusion - Kind mediocre
- Weird stuff like negative tempco resistors
Capacitors tend to be much larger than resistors. They're made out of metal-oxide-semiconductor stacks, or poly-oxide-poly. You can also use the P-N junction capacitance or the capacitance between parallel wires in a metal layer.
Inductors are typically too big to use in any but the highest-frequency circuits (>1 GHz). They're made from spirals of metal.
There are also extra-special transistors like the kind used in flash memory and DRAM. Those are definitely in a class of their own.