As far as the FAA, I'm sure it would be fine if there are no side affects which would affect strength, motor skills, cognitive ability, or alertness/consciousness.
But you should really consult an aviation medicine consultant BEFORE you talk to the government. These are normally ex-AME's who know the FAA policies, but are obligated only to you, not the FAA.
There are several available, I have used this one: www.aviationmedicine.com
Not a military doctor, but I've been subjected to pretty much every military physical exam there is over the last 25 years. I believe that the need to take special drugs on an ongoing basis will disqualify you. There are several criteria for military inductees, and one of them is that you have to be deployable anywhere...which creates problems if your required drug is not readily available at an outpost in some third-world pit. I know, you'll bring a big bottle, but what if it gets lost/stolen?
But again, contact the appropriate military recruiter. Odds are that you will not get a definitive answer until you actually take a DODMERB physical exam.