If its your primary home, it is not a bad idea, if you are comfortable with the monthly HOA fees.
The question I have is, what are you planning to do after 2 years? are you planning to sell it or rent it?
If you are planning to sell it, are you buying a fixer-upper or paying retail? Is they are appreciating in value or remaining steady?
If you are planning to rent it, what would be your cash flow after expenses? Based on current rates
You have to answer yourself this questions to make a decision
I have bought multiple condos over the years to rent or fix and sell, and it depends on the area, value, rents, etc.
Mu biggest issue is dealing with HOA. Sometimes if you are renting the unit and it is not insulated properly, then you hear footsteps and conversations from next-door units, so tenants complain a lot, but there is not much you can do.
Also, one time the unit above mine leaked water into my unit, and the HOA said I needed to talk to people living above mine to fix the issue and they didn't have the fund to fix the bathtub from leaking into mine, so I had to pay for the repairs.
Sometimes working with HOA and is painful, but other times is easy if the unit does not have problems