Both tools can be used to create cloud resources and configure machines but fundamentally they are very different.
Ansible is a list of actions that you apply linearly. Each action might be a noop if it already exists.
Terraform is a tree of resources that are applied by order of dependency. Terraform also records the previous run and deletes resources that are no longer in the code.
Generally, Ansible is great at performing actions on a lot of hosts. A sort of multi-ssh. And Terraform is best adapted to manage cloud resources.
Ansible is a list of actions that you apply linearly. Each action might be a noop if it already exists.
Terraform is a tree of resources that are applied by order of dependency. Terraform also records the previous run and deletes resources that are no longer in the code.
Generally, Ansible is great at performing actions on a lot of hosts. A sort of multi-ssh. And Terraform is best adapted to manage cloud resources.