Story from the Brahma Vaivarata Purana
In this story, Indra defeats Vrtrasura and releases the waters from bondage. Elevated to the rank of King of the gods, Indra orders the heavenly craftsman, Vishvakarma, to build him a grand. celestial palace. Full of pride, Indra continues to demand more and more improvements for the palace.As his vision unfold. He requires additional terraces and pavilions, more ponds, groves, and pleasure grounds. Whenever Indra arrived to appraise the work of Vishvakarma, he developed vision beyond vision of marvels remaining to be contrived.
Vishwakarma goes on making the improvement, and in the end he is not able to take in any more. Exhausted, Vishvakarma requests Lord Brahma the Creator, for help. Lord Brahma in turn appeals to Lord Vishnu, the Supreme Being, for assistance.
Early next morning,Lord Vishnu sets to visit Indra's palace in the form of a young brahmana boy. The boy is about ten years old,dwarfish, smiling, and radiant with the luster of wisdom. Indra discovers the boy amidst a cluster of enraptured, staring children. Indra welcomes him in and respectfully recieves him. Vishnu begins the conversation by praising Indra's palace, and then casually adds that no former Indra had succeeded in building such a palace. At first, Indra amused by the young boy's claim to know of former Indras. But the amusement turns to horror as the boy starts telling Indra about his former 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 course of the boy's talk, a long procession of Ants enters the palace and catches his attention. On seeing the procession of the Ants, the boy laughs loudly. Astonished and equally humbled, Indra asks the boy the reason for his amusement. To Indra's horror, the boy reveals that the ants were once Indras in their previous lifetimes! For all his celestial splendor, Indra comes to see his own insignificance in the creation when he sees the ants.
Another visitor then enters the hall. He is Lord Shiva, in the form of a hermit Lomasa, and Indra receives him and then sees another strange sight. On the chest of hermit, lie a circular cluster of hairs, which are intact at the circumference, but with a gap in the middle - the center is devoid of hairs. Indra worships him respectfully, and the anxiously asks him the reason for the disappearance of hair from the center of his chest.
Stating that he knows about his own short lifetime, Lord 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. He further adds that his own lifetime will be over by the period of Brahma!With this revelation, the Muni abruptly disappears and so does the young boy.Indra was startled and amazed to behold this sight, it seemed to him as if it was a dream.
No longer interested in wealth and honor, Indra rewards Vishvakarma and releases him from any further work on the palace. Indra having acquired wisdom, himself decides to leave his life of luxury to become a hermit and seek wisdom!
Horrified, Indra's wife Sachi asks Indra's spiritual guide Brihaspati to intervene and change her husband's mind and resolve. Brihaspati then 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. And thus the pride of Indra is vanquished, and wisdom awakens in the end!