Hello!
Can someone help me with exporting billing account reports to BigQuery service with terraform
and first question :
is it possible to configure and enable billing account export with terraform???
i’m trying to config this with terraform :
i asked google support and got answer : you can enable billing export :
Daily cost detail and Pricing only manually but they dont know about possibility from terraform!
i created bigquery dataset and got access to billing account and of course i created billing account sink!
but i can’t enable export to bigquery…
terraform code
resource "google_bigquery_dataset" "gke-bigquery-dataset" {
dataset_id = "gke_logs_dataset"
location = "US"
default_table_expiration_ms = null
delete_contents_on_destroy = true
labels = {
environment = terraform.workspace,
target = "sink",
}
}
resource "google_logging_billing_account_sink" "sink" {
name = "sink"
billing_account = "my billing account ID"
filter = ""
destination = "bigquery.googleapis.com/projects/${var.project_id}/datasets/${google_bigquery_dataset.gke-bigquery-dataset.dataset_id}"
}
resource "google_project_iam_binding" "log-writer-bigquery" {
role = "roles/bigquery.dataEditor"
members = [
google_logging_billing_account_sink.sink.writer_identity,
]
}