I am frustrated with/by taking different medicines every week.
I think you may use both. If you use by, we would tend to expect an 'agent', someone who is the instrument of your frustration: I am frustrated by (agent).
I am frustrated by (the doctor) telling me to take different medicines every week. This has a definite person as agent.
I am frustrated by (taking different medicines every week). The agent here is not a person, but an action.