When? Not in regard to the embassy. That wasn't an "attack," that was a
bunch of protesters upset at the actual attack by the US in retaliation for a "Pentagon contractor" being killed, not US soldiers (emphasis mine):
As was
reported in regard to the earlier rocket attack (emphasis mine):
"One U.S. civilian contractor was killed and several U.S. service members and Iraqi personnel were wounded in a rocket attack on an Iraqi military base in Kirkuk hosting Coalition troops, on Dec. 27 at 7:20 p.m. (Iraqi time)," the U.S.-led coalition said. "Iraqi Security Forces are leading the response and investigation. Further information will be released as it becomes available."
Iow, someone--presumed to have been backed by Iran--attacked an IRAQI military base that was "hosting" coalition forces, but there is no evidence that I can find that whoever fired a few katyusha's at the base was specifically targeting coalition forces or even knew if there were any such forces on the base.
Regardless, it was not a US base and the person killed was a US contractor, not a soldier, so nothing about what happened then and subsequently could possibly have been considered acts of war against the US, but everything Trump has done in response will rightly be considered acts of war by Iran and/or Iraq.
And certainly nothing was done to justify any further "retaliation" from Trump. Some angry protesters--who arguably
were justified considering 27 of their friends were evidently killed--stormed one of the most heavily fortified buildings in the world, got nowhere and set a fire while everyone inside the embassy was--as Trump affirmed--perfectly safe the entire time. It ended nearly as soon as it began, so what exactly were we "retaliating" against?
Not to mention the fact that the spin since has said nothing of retaliation for the embassy and
everything about:
“General Suleimani was actively developing plans to attack American diplomats and service members in Iraq and throughout the region,” a Pentagon statement said. “This strike was aimed at deterring future Iranian attack plans.”
So, which is it?
ETA: The only thing I can find is this bit from the Guardian piece linked above:
The strike came at a time when Iraq was already on the brink of an all-out proxy war, and hours after a two-day siege of the US embassy in Baghdad by a mob of PMF militants and their supporters. The Pentagon accused Suleimani of having masterminded the mob attack.
Except, again, it
wasn't a "mob attack."