Ertapenem injection is a medication used to treat serious infections, such as pneumonia. It works by killing the bacteria that is causing the infection. Ertapenem injection is usually given by IV (intravenous) injection.