antibiotics while pregnant?


I had gotten a really bad kidney and bladder infection around 30 weeks. they prescribed me to take keflex 2 times a day for 12 days, then once a day for the rest of my pregnancy.. does this sound wrong to anyone else? I'm scared that me and the baby will get used to the antibiotics and have issues after labor when Im no longer taking them. I don't want me or the baby to get to immune to them.