Bit late to the party, but there’s a couple different types of attitude indicators you might cross paths with.
The most basic one, such as is found in Cessna 172s and other general aviation airplanes, uses a single gyro to simply display the local horizon within a limited pitch and bank angle range. They are typically powered by a vacuum pump on the engine or a venturi on the exterior of the airplane on particularly old models. They’re simple, inexpensive, and reasonably accurate for normal flight, but can be damaged if you perform spin training while they’re operating. Needless to say, flight school mechanics get quite grumpy when an instructor does not warn/inform the shop that spin training will be taking place. Typical the gyro vacuum line will just be disconnected and an inline filter installed to protect the vacuum pump, and the system tagged “INOP” and logged as such until after spin training and the system is restored.
More advanced units will still have only one gyro, but will be electric and have much more range of motion, allowing for a complete 360° roll and 180° pitch display. These are typically used as backup units on modern jets, although standalone digital units are increasingly widespread.
The most advanced units, which display pitch, yaw, and roll information alongside a compass bearing, are, to my knowledge, not gyroscopic in nature and are instead driven by the aircraft’s navigation computer. These were quite common from the 1960s until the advent of the “glass cockpit”, but have largely been phased out of service due to the complexity of the mechanisms used and the versatility of primary flight displays and multi-function displays that make up a “glass cockpit”.