For conventional wireless networks, the main target of resource allocation (RA) is to efficiently utilize the available resources. Generally, there are no changes in the available spectrum, thus static spectrum allocation policies were adopted. However, these allocation policies lead to spectrum under-utilization. In this regard, cognitive radio networks (CRNs) have received great attention due to their potential to improve the spectrum utilization. In general, efficient spectrum management and resource allocation are essential and very crucial for CRNs. This is due to the fact that unlicensed users should attain the most benefit from accessing the licensed spectrum without causing adverse interference to the licensed ones. The cognitive users or called secondary users have to effectively capture the arising spectrum opportunities in time, frequency, and space to transmit their data. Mainly, two aspects characterize the resource allocation for CRNs: 1) primary (licensed) network protection and 2) secondary (unlicensed) network performance enhancement in terms of quality-of-service, throughput, fairness, energy efficiency, etc. CRNs can operate in one of three known operation modes: 1) interweave; 2) overlay; and 3) underlay. Among which the underlay cognitive radio mode is known to be highly efficient in terms of spectrum utilization. This is because the unlicensed users are allowed to share the same channels with the active licensed users under some conditions. In this paper, we provide a survey for resource allocation in underlay CRNs. In particular, we first define the RA process and its components for underlay CRNs. Second, we provide a taxonomy that categorizes the RA algorithms proposed in literature based on the approaches, criteria, common techniques, and network architecture. Then, the state-of-the-art resource allocation algorithms are reviewed according to the provided taxonomy. Additionally, comparisons among different proposals are provided. Finally, directions for future research are outlined.