Yes. You can make a once in a lifetime transfer from an IRA to an HSA. The transferred IRA amount + any HSA contributions for that year can’t exceed the annual contribution maximum. In other words, your IRA transfer counts against your annual HSA contribution limit. This also means you must be covered under an HSA eligible health plan when doing this. Please see more information below.
Please note that there is a special testing period for this kind of qualified funding distribution. The testing period is from the month are are eligible and contributed until the end of the 12th month of the next year, and you can contribute up to the total amount of the contribution limit for the year.
For example – you contribute to your HSA on June 13, 2018. You must be eligible to contribute to an HSA from June 1 2018-June 30, 2019.
That is distinguished from the last month rule, which says if you are covered 12/1 of a given year you can contribute for the whole year provided you remain eligible to contribute to an HSA through December of the following year.
Both methods basically test for allowing a maximum contribution without potentially being eligible for the full year but for the last-month rule, the test always starts 12/1.
Please be sure to consult with your tax professional. If it is not done properly, it can result in taxes and IRS penalties.