Carter served as secretary of Defense under President Barack Obama from February 2015 to January 2017.