cloud-foundation-fabric/modules/logging-bucket
Dan Farmer 52eb83758f Fix compute-vm:CloudKMS test for provider>=4.54.0
* TF provider >= 4.54.0 now returns `rsa_encrypted_key` for
  `google_compute_disk.disks["attached-disk"]` (see
  hashicorp/terraform-provider-google#4448)
* Add this field to expected model to fix test assertion failure
* Update required TF provider to 4.55.0 (latest) since the assertion
  will now fail with <4.54.0, which do not return `rsa_encrypted_key`
  * Updated the whole repo on advice from @ludoo
2023-02-28 15:10:22 +00:00
..
README.md Test documentation examples in the examples/ folder 2022-09-06 17:46:09 +02:00
main.tf Copyright bump (#410) 2022-01-01 15:52:31 +01:00
outputs.tf Copyright bump (#410) 2022-01-01 15:52:31 +01:00
variables.tf Copyright bump (#410) 2022-01-01 15:52:31 +01:00
versions.tf Fix compute-vm:CloudKMS test for provider>=4.54.0 2023-02-28 15:10:22 +00:00

README.md

Google Cloud Logging Buckets Module

This module manages logging buckets for a project, folder, organization or billing account.

Note that some logging buckets are automatically created for a given folder, project, organization, and billing account 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".

See also the logging_sinks argument within the project, folder and organization modules.

Examples

Create custom logging bucket in a project

module "bucket" {
  source      = "./fabric/modules/logging-bucket"
  parent_type = "project"
  parent      = var.project_id
  id          = "mybucket"
}
# tftest modules=1 resources=1

Change retention period of a folder's _Default bucket

module "folder" {
  source = "./fabric/modules/folder"
  parent = "folders/657104291943"
  name   = "my folder"
}

module "bucket-default" {
  source      = "./fabric/modules/logging-bucket"
  parent_type = "folder"
  parent      = module.folder.id
  id          = "_Default"
  retention   = 10
}
# tftest modules=2 resources=2

Variables

name description type required default
id Name of the logging bucket. string
parent ID of the parentresource containing the bucket in the format 'project_id' 'folders/folder_id', 'organizations/organization_id' or 'billing_account_id'. string
parent_type Parent object type for the bucket (project, folder, organization, billing_account). string
description Human-readable description for the logging bucket. string null
location Location of the bucket. string "global"
retention Retention time in days for the logging bucket. number 30

Outputs

name description sensitive
id ID of the created bucket.