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...
That’s one of the things tools like Terraform, Kubernetes or Mesos were designed for.
If the lowest common denominator is K8S/Mesos, while not using any of the cloud services, you’re doing it wrong.