IIRC, by law manufacturers are required to maintain parts and service for vehicles for a minimum of 10 years. Whether superseded, discontinued, whatever.
This is an urban legend. Safety defects have to be remedied by the manufacturer for a period of 10 years, but that remedy doesn't have to involve replacement parts.
https://www.nhtsa.gov/interpretations/timereplcepartpollak12...
But what happens when Musk decides the law doesn't apply to him...