Script require t Sync google cloud resources between multiple environment in Terraform

Hi Team,
We require a standard Terraform script to fulfill the below requirement :- 1: list down google bigquery datasets based on its project id or project name.
2: Compare missing bigquery datasets between multiple environment .
3: Sync the entire or missing resources from one environment (Ex:Dev) to SIT or vice -e versa.