1

I am trying to get list of tables in a bigquery dataset using terraform data source inside a module. I have written below code but it returns the entire path to the tables. I only need the table id.

data "google_bigquery_dataset" "dataset" { 
    dataset_id = "my-dataset"
    project    = "my-project"
}

output "bq_tables" {
    value = data.google_bigquery_dataset.dataset.access
}

I have checked the Google API documentation. The path it shows to the table list is given in this libnk. https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#DatasetReference What I fail to understand is the syntax to use if possible after the access object. e.g. I have tried be

low but it gives error Can't access attributes on a set of objects. Did you mean to access an attribute across all elements of the set?

value = data.google_bigquery_dataset.dataset.access[0].view.tableId[0] value = data.google_bigquery_dataset.dataset.access.view.tableId[0]

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.