The entire unit is known as the LCM (light control module) and contains things like vehicle mileage. You can’t just swap it for another one unless you get it coded to the car (otherwise it brings on a ‘mileage tamper’ warning on the dash).
You may be able to strip it down and just remove the switch part if yours is just mechanically damaged.