Hi team,
I have a question regarding DataScans in Dataplex. I’m deploying a DataScan task using Terraform; however, I’m encountering an issue where the option “Publish results to BigQuery and Dataplex Catalog UI” is not enabled after deployment.
Could you please advise on how to properly configure this option through Terraform?
Thanks in advance!
this is a fragment code in terraform:
Joel
Hi jvilchezv,
Welcome to Google Cloud Community!
To enable the “Publish results to BigQuery and Dataplex Catalog UI” option after deploying a Dataplex DataScan task using Terraform, you’ll need to ensure a few things are correctly configured both in your Terraform code and in your IAM setup.
With regards to Terraform configuration, in your google_dataplex_datascan resource, make sure you include the data_profile_spec or data_quality_spec block with the result_export configuration. The result_export block is key to publishing results to BigQuery. The Dataplex Catalog UI picks up metadata from these results if the scan is associated with a registered entity in a Dataplex lake and zone.
Also, ensure the Dataplex service account has these permissions:
roles/bigquery.dataEditor on the destination dataset
roles/dataplex.metadataReader and roles/dataplex.viewer on the lake and zone
- If scanning external tables (e.g. Cloud Storage), also grant
roles/storage.objectViewer on the bucket
If you’ve already deployed the scan and want to enable result publishing post-deployment:
-
Update your Terraform code to include the result_export block.
-
Run terraform apply to update the resource.
-
Confirm that the scan is linked to a Dataplex entity (not just a raw BigQuery table) so the Catalog UI can reflect the results.
If the issue persists, I suggest filing a defect report. This way you could have visibility on the progress of your concern as it is publicly available. Please note that I can’t provide any details or timelines at this moment. For future updates, I suggest keeping an eye out on the issue tracker.
For more details, you may check these links that you may find useful:
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi @ruthseki
Thanks for your answer,
This is my code that include the data_profile_spec
Horever, I can’tpublish results to BigQuery and Dataplex Catalog UI
Joel.