The variety of life in an ecosystem, including species diversity, genetic diversity, and ecosystem diversity.