This note describes the search for a Higgs boson decaying into diphotons in the CMS detector. Data-driven methods are used to evaluate the reconstruction and selection performance for the signal, and the background is evaluated from a fit to the data. The analysis is performed on a dataset corresponding to 1.09~\fbinv of data collected in 2011. Limits are set on the cross section of a Standard Model Higgs boson decaying to 2 photons, and on the cross section of a fermiophobic Higgs boson decaying to 2 photons. The expected exclusion limit at 95\% CL is less than 4 times the Standard Model cross section between 110 and 135~\GeVcc, and the actual excluded ratio to the SM cross section varies between 1.9 and 7.4. For a fermiophobic model the expected exclusion limit at 95\% CL is less than the cross section predicted by the model between 110 and 114~\GeVcc.