Obtaining correct results and behaviour on computing is a long-standing concern. Such guarantee can be obtained through fault and intrusion tolerance (FIT) mechanisms, which aim to tolerate accidental and arbitrary faults. Byzantine fault tolerant replication, when combined with proactive recovery techniques, can tolerate any number of arbitrary faults during the entire system life time. However, common vulnerabilities shared between replicas can compromise such tolerance. Diversity is a complementary mechanism that combines diverse resources to increase vulnerability independence between system components. Obtaining diversity automatically is a process that can be decomposed into two phases: creation and selection. The first phase consists in providing enough diverse resources to be considered, combined and selected in second phase. In this work we review basic FIT mechanisms, and analyze diversity in cloud computing environments. We present the DiversityAgent, a Java library for selecting cloud resources considering multiple diversity properties. Finally, we integrate this library with two use cases and evaluate its correctness and performance.