The interaction of solid-state electronic spins with deformations of their host crystal is an important ingredient in many experiments realizing quantum information processing schemes. Here, we theoretically characterize that interaction for a nitrogen-vacancy (NV) center in diamond. We derive the symmetry-allowed Hamiltonian describing the interaction between the ground-state spin-triplet electronic configuration and the local strain. We numerically calculate the six coupling-strength parameters of the Hamiltonian using density functional theory, and propose an experimental setup for measuring those coupling strengths. The importance of this interaction is highlighted by the fact that it enables to drive spin transitions, both magnetically allowed and forbidden, via mechanically or electrically driven spin resonance. This means that the ac magnetic field routinely used in a wide range of spin-resonance experiments with NV centers could in principle be replaced by ac strain or ac electric field, potentially offering lower power requirements, simplified device layouts, faster spin control, and local addressability of electronic spin qubits.