'Whole' can be a noun, an adjective, or an adverb.
For example:
- A whole orange (adjective, describing the orange as being completely intact)
- The whole of the orange (noun, meaning all of something).
See Cambridge Dictionary entries for more examples in line with this.
'Whole eternity' would be using the word as an adjective, and unfortunately, it isn't idiomatic. Eternity already means 'all of time', so it doesn't need an adjective to describe it any further - that would be like saying "everlasting forever". But "the whole of eternity" is idiomatic, as is "the rest of eternity", as they mean the remainder of eternity.
Having said that, although there is technically only one, all-encompassing 'eternity', we sometimes speak of "an eternity" (eg 'it feels like an eternity') to mean a very long period of time, or perhaps to describe eternity from a personal perspective. A quick Google shows quite a few uses of "a whole eternity".