google_logging_billing_account_bucket_config

Manages a billing account level logging bucket config. For more information see the official logging documentation and Storing Logs.

Example Usage

data "google_billing_account" "default" {
  billing_account = "00AA00-000AAA-00AA0A"
}

resource "google_logging_billing_account_bucket_config" "basic" {
  billing_account = data.google_billing_account.default.billing_account
  location        = "global"
  retention_days  = 30
  bucket_id       = "_Default"
}

Create logging bucket with index configs

resource "google_logging_billing_account_bucket_config" "example-billing-account-bucket-index-configs" {
  folder          = data.google_billing_account.default.billing_account
  location        = "global"
  retention_days  = 30
  bucket_id       = "_Default"

  index_configs   = {
    file_path   = "jsonPayload.request.status"
    type        = "INDEX_TYPE_STRING"
  }
}

Argument Reference

The following arguments are supported:

The index_configs block supports:

Attributes Reference

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

Import

This resource can be imported using the following format:

In Terraform v1.5.0 and later, use an import block to import this resource using one of the formats above. For example:

import {
  id = "billingAccounts/{{billingAccount}}/locations/{{location}}/buckets/{{bucket_id}}"
  to = google_logging_billing_account_bucket_config.default
}

When using the terraform import command, this resource can be imported using one of the formats above. For example:

$ terraform import google_logging_billing_account_bucket_config.default billingAccounts/{{billingAccount}}/locations/{{location}}/buckets/{{bucket_id}}