Introduction
Sometimes you need to use information about resources that already exist outside your current setup. Data sources let you look up this information so you can use it in your Terraform configuration without recreating those resources.
When you want to find the ID of a network that was created manually or by another team.
When you need to get the latest AMI image ID from AWS to launch a server.
When you want to use an existing database instance in your Terraform setup without managing it.
When you need to reference existing security groups to attach to new resources.
When you want to read configuration details from cloud resources created outside Terraform.