Diffractive optical elements are used as end mirrors and internal phase plates in an optical resonator. A single diffractive end mirror is used to produce an arbitrary real-mode profile, and two diffractive mirrors are used to produce complex profiles. Diffractive mirror feature size and phase quantization are shown to affect the shape of the fundamental mode, the fundamental-mode loss, and the discrimination against higher-order modes. Additional transparent phase plates are shown to enhance the modal discrimination of the resonator at the cost of reduced fabrication tolerances of the diffractive optics. A 10-cm-long diffractive resonator design is shown that supports an 8.5-mm-wide fundamental mode with a theoretical second-order mode discrimination of 25% and a negligible loss to the fundamental mode.