Iran is much less isolated than the 'West' may desire:1. Russia has a UN P5 veto. Given the state of the sanctions process (JCPOA) and the likely proximity of Iran to nuclear breakout status that veto would be handy to Iran.
2. Russia has railroads and grain, fertiliser, etc exports and a severe lack of warm water ports. Iran would like the hard cash and further help in building its railroads and ports, plus a handy backup to remind China that Iran has more than one friend.
3. Russia has some interesting technology Iran would like.
(Iran makes its own missiles. Iran has spent so long under sanctions that it knows how to play this game).
(Iran can get funds in and out for commercial purposes that are sanctions-compliant. )
Iran Resumes Diplomatic Relations with UAE and Kuwait, Talks Continue with Saudi Arabia
Amid positive signals surrounding nuclear talks among Iran and Western nations, both the United Arab Emirates and Kuwait have quietly restored diplomatic ties with Tehran. Iran's Foreign Ministry indicated Monday that talks with Saudi Arabia over resuming ties are also going in a positive...
www.voanews.com
These are very old relationships that are publicly acrimonious and privately conveniently practical. Of course the domestic Shia populations of the UAE, Saudi Arabia, Bahrain and Kuwait are mostly not welcome as anything above low level work.
This time, though, there is some serious political realignment happening. The US, in particular, has lost influence to Russia and China.
Ukraine is not a central factor in this realignment, but the Gulf countries all know that aligning solidly with any part is not in their own interest.