Exactly, after your discussion with your boss, write a formal resignation letter. Keep it simple and professional. No need to mention the specifics of your next opportunity if you're not comfortable. Once you've done that, continue to perform well until your notice period is complete. Leave your position with grace and professionalism.