Retirement tax questions

So I need earned income to contribute to a Roth IRA, but the amount I can contribute depends on my MAGI?