Iran presents Barack Obama with the biggest international test of a presidency mired in underachievement. Having fluffed his lines on Afghanistan, climate change and the Arab spring, he is under growing pressure to fulfil his pledge to prevent Iran obtaining nuclear weapons. A report by the UN's nuclear watchdog, the International Atomic Energy Agency, is expected to indicate that Obama is steadily failing in this objective, too. So what should he do? A wrong move now, and all the disappointments of the past three years could be wholly eclipsed by the most profound of moral ruptures.

It all comes down to Obama because, in the end, the US alone has the military firepower to stop Tehran in its tracks. Now Libya, supposedly, is done and dusted, Israeli officials have turned hyper, talking up the Iranian threat and arguing the time for diplomacy has all but passed. Those glum doomsayers, prime minister Binyamin Netanyahu, defence chief Ehud Barak, and president Shimon Peres, are frantically ringing alarm bells like a trio of demented churchwardens. Something, they say, must be done, preferably involving some very large American bombs.

Republican hopefuls in the 2012 presidential election are beating the war drums too, sensing that Iran is a bunker-buster issue that could penetrate Obama's strong record on national security. Governor Rick Perry of Texas, a leading candidate, is saying he would fully support a pre-emptive strike on Iran's nuclear installations. Another aspiring commander-in-chief, former senator Rick Santorum, describes Iran as the "enemy". It is campaign-trail nonsense, but it is dangerous nonsense – and it ramps up the pressure on Obama.

While Perry and the pacemakers play drums, the Gulf's Sunni-led monarchies, historical enemies of revolutionary Shia Iran, are on acoustic guitar. Their lament, orchestrated by Saudi Arabia, is music to the ears of tone-deaf neocons and oil executives everywhere: Iran is the snake skulking under every stone – backing Hamas in Gaza, Hezbollah in Lebanon, and the blood-drenched Alawite regime in Syria. An Iran armed with the bomb, they warn, would terrorise the region, threaten energy supplies, and provoke a pan-Arab nuclear arms race. Their solution? By "cutting off the head of the snake", Washington would defang these troubles and maybe get Syria (and pro-Tehran Iraq) thrown in for free.

So far the Obama White House is holding the line. Officials describe the IAEA report as "deeply troubling" and say all options remain open. But Obama's spokesman, Jay Carney, insists the US continues to focus primarily on diplomacy and sanctions to bring pressure to bear on Iran. This circumspection has solid foundations. Expert opinion suggests military action against Iran's numerous dispersed and protected nuclear-related targets would probably not work, would likely kill and maim many civilians, and would certainly provoke unpredictable, potentially devastating consequences.

A 2006 study produced by the US Army War College, Getting Ready for a Nuclear-Ready Iran, suggested up to 1,000 air sorties might be required to ensure underground sites were eradicated, including possible use of tactical nuclear weapons. Thus a pre-emptive strike would actually mean all out, escalating nuclear war with Iran, military retaliation against Israel, hostilities in neighbouring states, and a global oil shock. This might not look so great as Obama goes before the American people next November to seek a second term.

Yet alarmingly, the assumption that Obama would never be so dumb as to start another Middle East war is questioned. Author Jeffrey Goldberg suggests Obama would act militarily against Iran if he were persuaded Israel was at critical risk. "He doesn't want to be remembered as the president who failed to guarantee Israel's existence," Goldberg said. David Rothkopf, writing in Foreign Policy, is similarly sceptical. "If the president believes there is no other alternative to stopping Iran from gaining the ability to … manufacture nuclear weapons, he will seriously consider military action and it is hardly a certainty he won't take it." Cynical electoral calculations about walking tall in the world could influence such a decision.

The die is not yet cast. Unlike George Bush and Tony Blair contemplating Iraq in 2002, Obama has not already decided what to do. But here in dismal prospect, if he gets it wrong, is the unmaking of the Obama presidency, the betrayal of all those who believed his election heralded a shift away from the confrontational behaviours of the past. For Obama to attack Iran would be morally insupportable: it would be a rupture of faith. As a politician and as a leader, he would place himself beyond redemption.