But as far as "vendor lock-in", it's like developers wrapping database access up into a repository pattern just in case we want to change databases. In the real world, hardly anyone takes on massive infrastructure changes to save a few dollars.
On the other hand, there are frameworks like Serverless and Terraform to build infrastructure in a cloud vendor neutral method.