Comment by tim333
I still think Ukraine wasn't primarily about Russia's military security though. I mean the US/Nato could stick missiles in Estonia if they wanted.
It may have been about political security. If Ukraine which is basically at least part Russian had become a prosperous democracy on Russia's doorstep it would make it harder for Putin to justify his autocracy. In fact that one may come to pass.
It's not about missiles in this case. That's a strategic battle that Russia has largely already lost, though the advent of highly capable ICBMs/MIRV/etc with hypersonic maneuvering also makes vicinity less relevant in modern times. In this case it's about a land route for invasion and subsequent logistics. There are already NATO countries bordering Russia, but the land between them is extremely unfavorable - swamps, forests, and so on. It's simply not fit for what would be a large scale conflict.
Invasion into Russia would ideally go through Belarus, which is part of the reason that Belarus is such a critical ally for Russia, and now even hosts their nuclear weapons. Since that's not possible, the second best route (and third and forth and...) is through Ukraine, likely towards Kursk or Belgorod.
There's even something of an equal but opposite here on NATO's side - the Suwalki corridor [1]. It's a narrow stretch of land between Belarus and Kaliningrad (a Russian exclave) that, if controlled, would cut off the Baltic states from NATO. So if war ever breaks out between NATO and Russia, it would be a key strategic point and unsurprisingly, it's been heavily fortified by NATO - there are even hundreds of American troops there.
[1] - https://en.wikipedia.org/wiki/Suwa%C5%82ki_Gap