WASHINGTON — President Trump’s new acting director of national intelligence may hold the job for only about three weeks — unless the White House quickly finds a permanent nominee to offer to the Senate for confirmation.

The president tapped Richard Grenell, the American ambassador to Germany, on Wednesday to add the role overseeing the nation’s 17 spy agencies to his existing duties. Mr. Grenell agreed to hold the post for only a limited period of time, according to people familiar with his plan.

Federal law gives the president a great deal of flexibility to appoint whomever he chooses to the position on a temporary basis while his official nominee for the job awaits confirmation from the Senate. Late Thursday, Mr. Trump, traveling on the West Coast, told reporters he was considering naming Representative Doug Collins, Republican of Georgia and an ally of his currently running for the Senate, as the permanent director.

Under the Federal Vacancies Reform Act, Mr. Grenell can serve in his post only until March 11 unless the president formally nominates someone else for the job. That move would allow Mr. Grenell to serve for months longer as the nomination works its way through the Senate. Two administration officials said that officials were aware that they must nominate someone else soon, and that the process to find a formal nominee was underway.