(CNN) Republicans for years failed to gut the legacy of their nemesis Barack Obama: Now they can do so within a matter of days.

President Donald Trump and GOP lawmakers have the chance to shred the signature achievements of the 44th President's two terms -- Obamacare and the nuclear deal with Iran

Trump has often given the impression that overturning his predecessor's imprint on America and the world from the environment to health care, from foreign policy to Wall Street is the most compelling rationale of his presidency.

"Obamacare is a disaster, it is failing badly," Trump said Wednesday. Hours earlier, he said he'd already decided whether to stick to a nuclear pact he blasted on Tuesday as an "embarrassment to the United States."

The retired commander in chief meanwhile, is discovering the frustrations experienced by presidents when they transition from being the most powerful man in the world to having little say in the preservation of their legacies.

He said Wednesday it was "aggravating" for Democrats to keep having to save a law designed that protects people with pre-existing conditions and cancer survivors and is intended to provide affordable coverage to anyone.

But he also said that progress can come in fits and starts, perhaps steeling his supporters for tough days to come.

"Many you are young and maybe have only seen forward momentum, and may not have seen backward momentum yet," he said at a Gates Foundation event in New York . "Many of you may confront hurdles and roadblocks and disappointments in the future. And when that happens, that's the test."

Not dead yet

But while they are in peril, Obama's achievements are not dead yet. Obamacare after all, has been the law that refuses to die, surviving two Supreme Court challenges and thwarting previous attempts by the GOP monopoly on Washington power to kill it.

And the ramifications of ending the nuclear deal may yet weigh on the President's mind as he contemplates the prospect of traumatizing relations with key US allies and the prospect of another nuclear crisis to add to the showdown with North Korea if Iran then races for the bomb.

Some of the consequences of repealing Obamacare and dumping the Iran deal are also impossible to calculate before Trump and Republicans take the leap.

That means that even if Obama's legacy takes a hit in the days to come -- history may judge the current debates with a different eye.

Still, it would sicken Obama's supporters to see both legacy prizes swept away because both are central to the former president's concept of politics.

Obamacare was the centerpiece of his ambition to revive Democratic activist government and social reform to an extent not seen since the 1960s.

The Iran deal was the ultimate validation of his conviction that the United States should talk to its enemies in pursuit of audacious foreign policy goals.

But presidential legacies are seasoned over decades and centuries, not in the few months after a presidency ends. And Obama and Trump are fated to be judged against one for ever, and this is just an early historical skirmish.

Should Republicans for instance trigger chaos in insurance markets and put the US on a path to war with Iran, Obama's achievements may look more significant in retrospect.

However, if Republican alternatives prosper over the long term and deliver results, Obama's presidency could seem less successful in hindsight.

Deadlines

The fresh attempt to repeal Obamacare is taking place in the Senate, and involves some of the former president's consistent antagonists, including Sen. Lindsey Graham and Majority leader Mitch McConnell.

But the race to beat a deadline to pass a repeal bill before the end of the month that eliminates federal funding for Medicaid subsidies and elevates the role of the states in health care is not a guaranteed long term winner for Republicans.

That's one reason why the 11th-hour effort by Republicans is hanging by a thread, with holdouts including Alaska Sen. Lisa Murkowski and Arizona's John McCain under fearsome pressure to sign on.

"I think it has a very good chance," Trump said.

While he is rooting for health care action, Trump also appears to be moving closer to fulfilling a campaign promise to pull out of a deal that froze Iran's nuclear program in return for a lifting of international sanctions.

The fact he has the power to do so reflects the agreement's political Achilles' heel. Because of Republican opposition Obama could not get Congress to ratify it as a treaty, so billed it an executive agreement, meaning it could be overturned by a successor.

But pulling out of the deal could be as perilous for Trump as disrupting the health care system.

To begin with, Trump's antipathy to the agreement seems as much motivated by personal inclination as by a provable rationale that Iran is breaching it.

The administration's case is also weakened by its failure so far to show how it would stop Tehran resuming uranium enrichment that could lead to a push to make a bomb -- if Trump trashes the deal.

Iran tugged at the vulnerability of the President's position own Wednesday.

"I declare to you the Islamic Republic of Iran will not be the first country to violate the agreement, but it will respond decisively and resolutely to its violation by any party," Iranian President Hassan Rouhani told the United Nations

America's closest allies have also warned against pulling out of the deal -- raising the prospect of a rupture that could have long term consequences for Trump's presidency.

"If we simply throw out this agreement, it can't be replaced. There's nothing to replace it," said French President Emmanuel Macron on Tuesday.

His warning highlights a dilemma that Trump may or may not wish to consider: As he sets about diminishing Obama's legacy -- he is taking substantial risks with his own.