In this story from the Brahmavaivarta Purana,Indra defeats Vṛtrá and releases the waters. Elevated to the rank of King of the gods, Indra orders the heavenly craftsman, Vishvakarma, to build him a grand palace. Full of pride, Indra continues to demand more and more improvements for the palace. At last, exhausted, Vishvakarma asks Brahma the Creator for help. Brahma in turn appeals to Vishnu the Supreme Being.
Vishnu visits Indra's palace in the form of a Brahmin boy; Indra welcomes him in. Vishnu praises Indra's palace, casually adding that no former Indra had succeeded in building such a palace. At first, Indra is amused by the Brahmin boy's claim to know of former Indras. But the amusement turns to horror as the boy tells about Indra's ancestors, about the great cycles of creation and destruction, and even about the infinite number of worlds scattered through the void, each with its own Indra. The boy claims to have seen them all. During the boy's speech, a procession of ants had entered the hall. The boy saw the ants and laughed. Finally humbled, Indra asks the boy why he laughed. The boy reveals that the ants are all former Indras.
Another visitor enters the hall. He is Shiva, in the form of a hermit. On his chest lies a circular cluster of hairs, intact at the circumference but with a gap in the middle. Shiva reveals that each of these chest hairs corresponds to the life of one Indra. Each time a hair falls, one Indra dies and another replaces him.
No longer interested in wealth and honor, Indra rewards Vishvakarma and releases him from any further work on the palace. Indra himself decides to leave his life of luxury to become a hermit and seek wisdom. Horrified, Indra's wife Shuchi asks the priest Brihaspati to change her husband's mind. He teaches Indra to see the virtues of both the spiritual life and the worldly life. Thus, at the end of the story, Indra learns how to pursue wisdom while still fulfilling his kingly duties.