In simple words Terraform Data Source is:
- Bridge between “Terraform-created” and “non-Terraform-created” infrastructure
- A Terraform data source lets you query or fetch existing information from outside Terraform so you can use it inside your Terraform configuration.
Let me give an example:
Let's say you have an existing VPC created but not managed by terraform, now you want to create a EC2 in that VPC, so you need the VPC info, in such scenario you can use Data Source.