Gram-positive bacteria synthesize the second messenger cyclic di-AMP (c-di-AMP) to control cell wall and potassium homeostasis and to secure the integrity of their DNA. In the firmicutes, c-di-AMP is essential for growth. The model organism Bacillus subtilis encodes three diadenylate cyclases and two potential phosphodiesterases to produce and degrade c-di-AMP, respectively. Among the three cyclases, CdaA is conserved in nearly all firmicutes, and this enzyme seems to be responsible for the c-di-AMP that is required for cell wall homeostasis. Here, we demonstrate that CdaA localizes to the membrane and forms a complex with the regulatory protein CdaR and the glucosamine-6-phosphate mutase GlmM. Interestingly, cdaA, cdaR, and glmM form a gene cluster that is conserved throughout the firmicutes. This conserved arrangement and the observed interaction between the three proteins suggest a functional relationship. Our data suggest that GlmM and GlmS are involved in the control of c-di-AMP synthesis. These enzymes convert glutamine and fructose-6-phosphate to glutamate and glucosamine-1-phosphate. c-di-AMP synthesis is enhanced if the cells are grown in the presence of glutamate compared to that in glutamine-grown cells. Thus, the quality of the nitrogen source is an important signal for c-di-AMP production. In the analysis of c-di-AMP-degrading phosphodiesterases, we observed that both phosphodiesterases, GdpP and PgpH (previously known as YqfF), contribute to the degradation of the second messenger. Accumulation of c-di-AMP in a gdpP pgpH double mutant is toxic for the cells, and the cells respond to this accumulation by inactivation of the diadenylate cyclase CdaA.