Catalyzes the ATP-dependent biosynthesis of glutamine from glutamate and ammonia. ATP + L-glutamate + NH4(+) = ADP + H(+) + L-glutamine + phosphate Binds 2 Mg(2+) ions per subunit. The activity of this enzyme could be controlled by adenylation under conditions of abundant glutamine. Oligomer of 12 subunits arranged in the form of two hexagons. Two forms of glutamine synthetase (GSI and GSII) can be found in this nitrogen fixing bacteria, GSI is a typical prokaryotic glutamine synthetase whereas GSII is similar to the eukaryotic enzyme. Belongs to the glutamine synthetase family.