» google_logging_project_bucket_config

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

» Example Usage

resource "google_project" "default" {
    project_id = "your-project-id"
    name       = "your-project-id"
    org_id     = "123456789"

resource "google_logging_project_bucket_config" "basic" {
    project    = google_project.default.name
    location  = "global"
    retention_days = 30
    bucket_id = "_Default"

» Argument Reference

The following arguments are supported:

  • project - (Required) The parent resource that contains the logging bucket.

  • location - (Required) The location of the bucket. The supported locations are: "global" "us-central1"

  • bucket_id - (Required) The name of the logging bucket. Logging automatically creates two log buckets: _Required and _Default.

  • description - (Optional) Describes this bucket.

  • retention_days - (Optional) Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.

» Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/buckets/{{bucket_id}}

  • name - The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"

  • lifecycle_state - The bucket's lifecycle such as active or deleted. See LifecycleState.

» Import

This resource can be imported using the following format:

$ terraform import google_logging_project_bucket_config.default projects/{{project}}/locations/{{location}}/buckets/{{bucket_id}}