The tooling for Terraform with bare metal is poor, but it is out there. There are plugins for MAAS, Cobbler, Some giant HPE thing I never wanted to touch.
If you're willing to write code, I found it a good fit for provisioning servers over ILO/Redfish.