How to generate the dynamic block with template data

I am trying to create datadog dashboards for different services. I would like to generate the widget block dynamically for the resource.
The goal is we would like to store RDS, SQS, Redis widget code in files and read the whole content inside resource. Say, if one service needs RDS and SQS and other service need SQS and Redis only. We would like to create these dynamically with terraform.
Is adding the entire content from file possible with dynamic blocks?