Terraform vs Ansible
Terraform is a declarative provisioning tool: you describe the desired end state (a VPC, a database, a cluster) and it figures out what to create, change, or destroy to get there, tracking everything in a state file. Ansible is primarily a configuration management and automation tool: it runs ordered tasks (install a package, edit a config, restart a service) against machines that already exist, using a push model over SSH with no state file.
Terraform
Ansible
Use Terraform when
You need to create, version, and safely change cloud infrastructure itself, networks, compute, managed services.
Use Ansible when
The infrastructure already exists and you need to configure software on it, or run repeatable operational tasks.
Many teams use both: Terraform to stand up the servers, Ansible to configure what runs on them. Pick based on whether the job is "create infrastructure" or "configure a machine".
Study this on the roadmap