google_logging_billing_account_sink

Example Usage

resource "google_logging_billing_account_sink" "my-sink" {
  name            = "my-sink"
  description = "some explanation on what this is"
  billing_account = "ABCDEF-012345-GHIJKL"

  # Can export to pubsub, cloud storage, or bigquery
  destination = "storage.googleapis.com/${google_storage_bucket.log-bucket.name}"
}

resource "google_storage_bucket" "log-bucket" {
  name     = "billing-logging-bucket"
  location = "US"
}

resource "google_project_iam_binding" "log-writer" {
  project = "your-project-id"
  role = "roles/storage.objectCreator"

  members = [
    google_logging_billing_account_sink.my-sink.writer_identity,
  ]
}

Argument Reference

The following arguments are supported:

The bigquery_options block supports:

The exclusions block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Import

Billing account logging sinks can be imported using this format:

In Terraform v1.5.0 and later, use an import block to import billing account logging sinks using one of the formats above. For example:

import {
  id = "billingAccounts/{{billing_account_id}}/sinks/{{sink_id}}"
  to = google_logging_billing_account_sink.default
}

When using the terraform import command, billing account logging sinks can be imported using one of the formats above. For example:

$ terraform import google_logging_billing_account_sink.default billingAccounts/{{billing_account_id}}/sinks/{{sink_id}}