Bacteria from resource islands can adapt to different extreme conditions in semi-arid regions. We aimed to determine the potential resistance and tolerance to heavy metals from the bacterial community under the canopy of three resource islands in a semi-arid zone of the Colombian Caribbean. Total DNA was extracted from soil and through a metagenomics approach, we identified genes related to heavy metal tolerance and resistance under the influence of drought and humidity conditions, as well as the presence or absence of vegetation. We characterized the genomes of bacterial isolates cultivated in the presence of four heavy metals. The abundances of genes related to heavy metal resistance and tolerance were favored by soil moisture and the presence of vegetation. We observed a high abundance of resistance genes (60.4%) for Cu, Zn, and Ni, while 39.6% represented tolerance. These genes positively correlated with clay and silt content, and negatively correlated with sand content. Resistance and tolerance were associated with detoxification mechanisms involving oxidoreductase enzymes, metalloproteases, and hydrolases, as well as transmembrane proteins involved in metal transport such as efflux pumps and ion transmembrane transporters. The Bacillus velezensis C3-3 and Cytobacillus gottheilii T106 isolates showed resistance to 5 mM of Cd, Co, Mn, and Ni through detoxification genes associated with ABC pumps, metal transport proteins, ion antiporter proteins, and import systems, among others. Overall, these findings highlight the potential of bacteria from resource islands in bioremediation processes of soils contaminated with heavy metals.