I think a lot of the infrastructure-as-code motivation comes from struggling with documentation. At least it provides a unambiguous source of truth which is going to be correct. Understanding it and it’s quirks can be tedious but it’s better than port scanning and guessing hostnames to figure out what infrastructure exists.