Elemental Armor (5e Feat)
From D&D Wiki
Prerequisites: The ability to cast at least one spell; proficiency in light, medium or heavy armor
When you gain this feat, choose one of the following damage types: acid, cold, fire, lightning, or thunder. While you are wearing armor, you have resistance against that damage type.
In addition, if you are wearing armor and are hit with a melee attack, you can choose to have the creature that hit you have vulnerability to your chosen damage type until the end of your next turn. If you choose to do this, you loose the benefits of this feat until you finish a short or long rest.
You can select this feat multiple times. Each time you do so, you must choose a different damage type.