it attempts to and encourages declarative configuration, but is very hard to keep that way. it is difficult and requires determination to make Terraform do something in a non-declarative fashion.
the end result is that when I look at a Terraform configuration I can very easily tell what is going on, because the end result is exactly what I read. where with Ansible, it very much depends on understanding the current state of the server you are about to run this playbook on, and you just have to cross your fingers and hope for the best.
Terraform is a tool designed to overcome the problems that "best practices" will supposedly prevent you from introducing in your Ansible playbook.
don't get me wrong. Ansible is a wonderful tool for certain applications (configuration management). I would just never use it to spin up infrastructure again.
Ansible seems to focus on managing infrastructure, Terraform shines when creating infrastructure.
https://learn.hashicorp.com/terraform/aws/eks-intro
So, I'd say Kubernetes itself does more heavy lifting but not all of it?
https://github.com/JasonCarter80/contoso_aws_k8s/tree/master...