I think he is more an opportunist.
The hamas attack was well timed to draw attention from the failure of his invasion of Ukraine