Not only this, but, critically, there is now an entire *industry* devoted to preventing cloud-provider lock-in. You can't throw a penny into an SF crowd without hitting someone working on this.
Because capitalism is efficient, and because there are lots of dollars chasing the Lock-in Problem, and moreover because AWS is the market leader, it has an enormous amount to lose. Even if 0.5% of the aforementioned startups succeed in reducing dollars lost to lock-in by (say) 10%, on average, that's billions that AWS stands to lose. (By my armchair math)
The market prices these risks in.