FiveThirtyEight wrote an article on this just last week: Why Americans Might Be Convinced To Support A War With Iran. In the article, they report on several polls that ask about a potential conflict with Iran in different ways.
To start, they report on a SurveyMonkey poll which finds very low support for intervention in response to the attack on Saudi oil facilities:
And a SurveyMonkey poll by Business Insider conducted earlier this week found that only 13 percent of Americans support a U.S. military response to the attack on Saudi oil facilities. The poll, which didn’t mention Iran specifically, also found that about half of Americans felt the U.S. should either remove itself entirely from the situation or limit its response to condemning the attack and possibly sanctioning the perpetrators.
When you ask about intervention to prevent Iran from getting nuclear weapons, however, support increases. They cite 3 polls which provide strikingly different levels of support
A poll by The Chicago Council on Global Affairs found broad support for vague and unspecified military intervention in Iran to prevent them from acquiring nuclear weapons. However, when you ask about specific kinds of interventions, support drops significantly:
A survey conducted in June found that the use of military force in Iran may be one military intervention that the U.S. public could get behind, especially if Americans perceive Iran’s nuclear capabilities as a threat. In that survey, which was released earlier this month by the Chicago Council on Global Affairs, 70 percent of respondents, including 82 percent of Republicans and 66 percent of Democrats, supported using U.S. troops to stop Iran from obtaining nuclear weapons. And as you can see in the chart below, there’s a lot more support for sending troops to Iran than to other parts of the world, including Iraq, Syria and China.

But while the Chicago Council on Global Affairs poll might seem to indicate that an overwhelming majority of Americans are ready to go to war over Iran’s nuclear capabilities, it did find that support dropped when specific types of military interventions were proposed: In response to a question that asked respondents what strategies they’d favor if Iran withdrew from the nuclear deal altogether, 51 percent said they’d support conducting cyberattacks against Iran’s computer systems, 48 percent said they’d support airstrikes against Iran’s nuclear facilities, and 40 percent said they’d support sending troops to destroy Iran’s nuclear facilities
A third poll from Fox News from July found support for military action at 53%:
a July poll from Fox News asked about military intervention only in Iran. The Fox News poll found that far fewer Americans — 53 percent — favored military action to stop the development of nuclear weapons.
Finally, a Gallup poll from July finds that 78% prefer economic and diplomatic efforts over military action, though 42% would favor military action if that failed:

The ultimate takeaway is that military action against Iran is not very popular right now, but that a case built on protecting America (as opposed to Saudi Arabia) could change things:
if [Trump] were to exercise a military option against Iran, the polling we have so far seems to indicate that it may not be very popular — but that could change if the administration can convince the public that Iran’s actions are a threat to the United States.