Spot the Signs. Do you have a good relationship with your manager? Is he or she relatively reasonable? Do you have regular one_on_ones where you talk about your career goals and growth? If so, it's likely that your boss will accept your resignation with grace, help develop a plan of action for your last two weeks, and maybe even attend your farewell happy hour.
Why a Resignation Letter? In these digital times, why should we submit a resignation letter, anyway? A paper trail does seem old_fashioned, but in this case, it's a best practice. It makes your intentions clear, as well as the conditions. You're removing any ambiguity about the end of your time there.