Use the kubectl_path_documents data source
masterThe kubectl_path_documents data source allows you to find and split multi-document YAML files matching a specific glob pattern. It combines the functionality of finding files and parsing their individual YAML documents into a single resource. It also supports Terraform-style template rendering, allowing you to parameterize your manifests using variables.
data "kubectl_path_documents" "docs" {
pattern = "./manifests/*.yaml"
}