After you file

Assuming you qualify, you can still contribute to a 2017 IRA by April 17, 2018. And yes, you have to amend to claim the deduction.