He was later president of Iran from 1981 to 1989 before becoming Supreme Leader for life. who has been Iran 's president since 2005 , was actively involved in the Islamic revolution and was a founding member of the student union that took over the US embassy in Tehran in 1979 .