Valmiki Ramayana Kishkindha Kanda Sarga 66 Shloka 28
Original Shlokaवज्रस्य च निपातेन विरुजं त्वां समीक्ष्य च। सहस्रनेत्रः प्रीतात्मा ददौ ते वरमुत्तमम्।।4.66.28।। स्वच्छन्दतश्च मरणं तेभूयादिति वै प्रभो।
1 source checked for this shloka
प्रभो O lord, सहस्रनेत्रः the thousandeyed, वज्रस्य thunderbolt's, निपातेन by striking, त्वाम् you, विरुजम् not hurt, समीक्ष्य च on observing that, प्रीतात्मा a pleased self, तव your, स्वच्छन्दतः at your wish, मरणम् death, ते you, भूयात् will be, इति thus, उत्तमम् best, वरम् boon, ददौ gave.
'O lord observing that you are not hurt even when struck by the thunderbolt, Indra offered, one of the best boons to you, to choose to die only when you wish.