Making it harder to switch is by definition anti-competitive
The whole point is that companies should not be trying to trick or stifle customers in any way from making a rational decision that is in their own best interest, including leaving their service.
The whole game here is "what can we get away with" and playing that game to start with is unethical.
It isn't. Anti-competitive would be using one's market power to drive out competition or keep competition from arising. There is no reasonable definition of "anti-competitive" for Amazon in this case, since Google and Microsoft are (arguably) even better positioned to compete (since they are tech companies, where Amazon is not). To avoid the lock-in, simply choose a different provider, or self-host. There is literally tons of competition in AWS' market.
Every provider out there optimizes the integration between its own services and makes sure the products in its ecosystem work nicely together. Meanwhile they cannot account for all other usages outside their systems. That's far from "making it harder to switch".
Yes I work for AWS Professional Services now. But I’ve seen the same with Azure and on prem in previous jobs. It hardly ever makes business sense not to go all in on whatever your infrastructure decisions are.