Skip to content

googleLoggingOrganizationBucketConfig

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

\~> Note: Logging buckets are automatically created for a given folder, project, organization, billingAccount and cannot be deleted. Creating a resource of this type will acquire and update the resource that already exists at the desired location. These buckets cannot be removed so deleting this resource will remove the bucket config from your terraform state but will leave the logging bucket unchanged. The buckets that are currently automatically created are "_Default" and "_Required".

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const dataGoogleOrganizationDefault =
  new google.dataGoogleOrganization.DataGoogleOrganization(this, "default", {
    organization: "123456789",
  });
new google.loggingOrganizationBucketConfig.LoggingOrganizationBucketConfig(
  this,
  "basic",
  {
    bucket_id: "_Default",
    location: "global",
    organization: dataGoogleOrganizationDefault.organization,
    retention_days: 30,
  }
);

Argument Reference

The following arguments are supported:

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

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

  • bucketId - (Required) The name of the logging bucket. Logging automatically creates two log buckets: required and default.

  • description - (Optional) Describes this bucket.

  • retentionDays - (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. Bucket retention can not be increased on buckets outside of projects.

Attributes Reference

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

  • id - an identifier for the resource with format organizations/{{organization}}/locations/{{location}}/buckets/{{bucketId}}

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

  • lifecycleState - 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_organization_bucket_config.default organizations/{{organization}}/locations/{{location}}/buckets/{{bucket_id}}