user11527457
user11527457

Reputation: 41

GCP cloud billing export into BQ through terraform

Can we automate GCP billing export into BQ through Terraform?

I tried below terraform code but it's not working. So, not sure if GCP billing exporting into BQ would be possible through Terraform or not.

resource "google_logging_billing_account_sink" "billing-sink" {
  name            = "billing-sink"
  description     = "Billing export"
  billing_account = "**********"
  unique_writer_identity = true
  destination = "bigquery.googleapis.com/projects/${var.project_name}/datasets/${google_bigquery_dataset.billing_export.dataset_id}"
}

resource "google_project_iam_member" "log_writer" {
  project = var.project_name
  role    = "roles/bigquery.dataEditor"
  member  = google_logging_billing_account_sink.billing-sink.writer_identity
}

Upvotes: 3

Views: 1036

Answers (1)

Hemanth Kumar
Hemanth Kumar

Reputation: 3762

Unfortunately,there is no such option. This concern is already raised under github and this is in enhancement. Currently there is no ETA available. I can see in terraform only google_logging_billing_account_sink and Automating logs export to BigQuery with Terraform.

Upvotes: 2

Related Questions