The Apple iMacs of old weren’t known for their upgradability, the RAM was soldered on and the CPU was not modular either. There was no way of upgrading if you needed to, but inspection of the Apple iMac 2017 reveals that you can indeed upgrade the CPU and memory if you have the courage to do so as this is not an easy process.
Again, this is not something that Apple has highlighted and it is not recommended that you try to do this unless you know what you are doing. The people over at iFixit were able to take the Apple iMac 2017 apart and in their teardown, they found that you can add RAM, as much as you want and it would be cheaper as compared to the price Apple is charging.
The RAM used in the Apple iMac 2017 is pretty standard SK Hynix 8 Gb DDR4 SDRAM. The CPU is also modular and the socket is a standard LGA 1151 so you can use any 6th or 7th gen CPU. Again getting to the socket is not easy and you have to put the whole things back again at the end of the day which is not something everyone can pull off.
Seeing how this is a very expensive device it would be better to avoid doing this on your own and it is important to note that removing the heatsink voids any warranty or insurance that you might have. If you plan to do this, it would be wise to wait till the warranty expires.
It is interesting to note that the display panel used in the device is from LG. These are great devices if you can muster up the money. Let us know what you think about the Apple iMac 2017 and whether you would risk opening it up and upgrading the RAM and CPU.