I’m trying to authorize my bigquery views against their base tables using a terraform script. But I’m unable to do as it is throwing me error as mentioned below. Can someone able to help me, please?
Error -
Error: Unsupported argument
on main.tf line 120, in module “data_authorized_views”
120: authorized_datasets = [
An argument named “authorized_datasets” is not expected here.
Error: Unsupported argument
On main.tf line 120, in module “data_authorized_views”
120: authorized_views = [
An argument named “authorized_views” is not expected here.
~5.4.2 is not a valid Terraform version expression. I suppose you mean ~> 5.4.2.
That module version supports the parameter names in your earlier post.
I even copied your config snippet into a local file, fixed the incorrect smart quotes and missing closing brace, replaced the references to other data with empty values, and confirmed that terraform validate passes.
That’s all I can say based on the information you’ve provided.
When executing the above terraform (terraform plan), getting the following error
bash-5.1$ terraform plan
╷
│ Error: Invalid value for module argument
│
│ on main.tf line 1153, in module "edw_authorized_views":
│ 1153: authorized_views = [
│ 1154: {
│ 1155: project_id = data.google_project.edw-prcd-bq.project_id
│ 1156: dataset_id = "edw_publish_view_test"
│ 1157: table_id = []
│ 1158: }
│ 1159: ]
│
│ The given value is not suitable for child module variable "authorized_views" defined at .terraform/modules/edw_authorized_views/modules/authorization/variables.tf:39,1-28: element 0: attribute "table_id": string
│ required.
╵
╷
│ Error: Unsupported block type
│
│ on .terraform/modules/edw_authorized_views/modules/authorization/main.tf line 68, in resource "google_bigquery_dataset_access" "authorized_dataset":
│ 68: dataset {
│
│ Blocks of type "dataset" are not expected here.
This is what it is there in 68th line of - .terraform/modules/edw_authorized_views/modules/authorization/main.tf