Evidently this was in retaliation for a response by US forces for an Iran proxy group killing a US contractor and wounding others. This President is not Jimmy Carter or Hillary Clinton who both let Iran get away with harming Americans.
Trump is tough and Iran is testing him. The Iranian people have been protesting their government for months and protesters are being killed. The leadership in Iran is trying to create a diversion from their crimes against their own citizens.
The Iranian leadership is ill advised to test Trump’s resolve.