I agree with my sibling-commenter that this is a
bit of a stretch, and I also think that merely not using a cloud provider's integrated database offering (e.g. RDS instead of running ones own on EC2 with or without EBS) doesn't invalidate all the benefits.
However, you do bring up an important point, which is a criticism I've always had for the term "infrastructure as code": Unless the underlying hardware is identical in performance, that code isn't really describing/commanding anything deterministic.
This is especially true for databases or anything I/O-sensitive like message queues or stream processing.
It would certainly make "cloud agnosticism" a much less trivial exercise.
At the risk of sounding ad-hominem, I generally find that it is software engineers whose experience is primarily at higher levels of abstraction who under-estimate how much it matter (or, conversely, over-estimate how much software or "code" can just solve such problems).
See also https://en.wikipedia.org/wiki/Fallacies_of_distributed_compu...