Is it legal to fill a newly created position without posting it publicly?
1. If you are a governmental agency required to publicly advertise job openings.
2. If you are unionized and your contract with your union requires you to post and/or publicly advertise job openings.
3. If your policy manual strictly requires that all job openings be posted and/or publicly advertised.
If your situaiton is number three, I urge you to have that policy changed to give your management team the right to determine when a job may be filled without being posted or publicly advertised.
Criteria should be included so that no abuse results (e.g., the management team stops posting or advertising most or all job openings). Your management team should be able to make these kinds of determinations based on the business needs of the company within the bounds of the criteria set in the policy.
Hopefully, the person you hired meets all of the job criteria (required qualifications: education, knowledge, experience, skills) so that you can defend your hiring decision without hesitation.