Resonant Raman scattering from AlxGa1−xN (x⩽0.17) layers in (Al, Ga, In)N heterostructures has been studied using optical excitation at a photon energy of hνL=3.72 eV (333.61 nm). Tuning of the AlGaN band-gap energy, and thus of the resonance condition, was achieved by variation of the sample temperature. A pronounced outgoing resonance behavior was observed for first- and second-order Raman scattering by the AlGaN A1(LO) phonon, which allows a separation of the AlGaN LO phonon signal from the corresponding GaN phonon line even in the presence of much thicker surrounding GaN layers. The composition dependence of the AlxGa1−xN A1(LO) phonon mode was determined to ωLO(x)=734+356.8x−814.7x2 (cm−1) for the present excitation conditions (hνL=3.72 eV) and composition range (x⩽0.17). The use of resonantly enhanced Raman scattering by the AlGaN A1(LO) phonon allowed us to assess nondestructively the composition of the AlGaN cladding layers in an (Al, Ga, In)N laser structure, even though the Raman spectrum recorded for nonresonant subband-gap excitation was completely dominated by scattering from the much thicker GaN layers in the structure.