The cosmic-ray and gas content of the Cygnus region as measured in \gamma-rays by the Fermi Large Area Telescope