Terraform talks to "clouds", where as Ansible talks to devices. Whilst clouds do have many devices, I feel like Ansible has a greater ability to absorb likeness/distinctiveness (ships), over a greater scale than terraform.
I don't use Terraform but from my understanding Terraform is more for "what kind of server hardware/VM/container/... do I want" and less "which configuration do I want on that server/VM/container/..."