FolderBucketConfig

class FolderBucketConfig : KotlinCustomResource

Manages a folder-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 state but will leave the logging bucket unchanged. The buckets that are currently automatically created are "_Default" and "_Required".

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.organizations.Folder("default", {
displayName: "some-folder-name",
parent: "organizations/123456789",
});
const basic = new gcp.logging.FolderBucketConfig("basic", {
folder: _default.name,
location: "global",
retentionDays: 30,
bucketId: "_Default",
indexConfigs: [{
fieldPath: "jsonPayload.request.status",
type: "INDEX_TYPE_STRING",
}],
});
import pulumi
import pulumi_gcp as gcp
default = gcp.organizations.Folder("default",
display_name="some-folder-name",
parent="organizations/123456789")
basic = gcp.logging.FolderBucketConfig("basic",
folder=default.name,
location="global",
retention_days=30,
bucket_id="_Default",
index_configs=[{
"field_path": "jsonPayload.request.status",
"type": "INDEX_TYPE_STRING",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.Organizations.Folder("default", new()
{
DisplayName = "some-folder-name",
Parent = "organizations/123456789",
});
var basic = new Gcp.Logging.FolderBucketConfig("basic", new()
{
Folder = @default.Name,
Location = "global",
RetentionDays = 30,
BucketId = "_Default",
IndexConfigs = new[]
{
new Gcp.Logging.Inputs.FolderBucketConfigIndexConfigArgs
{
FieldPath = "jsonPayload.request.status",
Type = "INDEX_TYPE_STRING",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/logging"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.NewFolder(ctx, "default", &organizations.FolderArgs{
DisplayName: pulumi.String("some-folder-name"),
Parent: pulumi.String("organizations/123456789"),
})
if err != nil {
return err
}
_, err = logging.NewFolderBucketConfig(ctx, "basic", &logging.FolderBucketConfigArgs{
Folder: _default.Name,
Location: pulumi.String("global"),
RetentionDays: pulumi.Int(30),
BucketId: pulumi.String("_Default"),
IndexConfigs: logging.FolderBucketConfigIndexConfigArray{
&logging.FolderBucketConfigIndexConfigArgs{
FieldPath: pulumi.String("jsonPayload.request.status"),
Type: pulumi.String("INDEX_TYPE_STRING"),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Folder;
import com.pulumi.gcp.organizations.FolderArgs;
import com.pulumi.gcp.logging.FolderBucketConfig;
import com.pulumi.gcp.logging.FolderBucketConfigArgs;
import com.pulumi.gcp.logging.inputs.FolderBucketConfigIndexConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new Folder("default", FolderArgs.builder()
.displayName("some-folder-name")
.parent("organizations/123456789")
.build());
var basic = new FolderBucketConfig("basic", FolderBucketConfigArgs.builder()
.folder(default_.name())
.location("global")
.retentionDays(30)
.bucketId("_Default")
.indexConfigs(FolderBucketConfigIndexConfigArgs.builder()
.fieldPath("jsonPayload.request.status")
.type("INDEX_TYPE_STRING")
.build())
.build());
}
}
resources:
default:
type: gcp:organizations:Folder
properties:
displayName: some-folder-name
parent: organizations/123456789
basic:
type: gcp:logging:FolderBucketConfig
properties:
folder: ${default.name}
location: global
retentionDays: 30
bucketId: _Default
indexConfigs:
- fieldPath: jsonPayload.request.status
type: INDEX_TYPE_STRING

Import

This resource can be imported using the following format:

  • folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} When using the pulumi import command, this resource can be imported using one of the formats above. For example:

$ pulumi import gcp:logging/folderBucketConfig:FolderBucketConfig default folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}}

Properties

Link copied to clipboard
val bucketId: Output<String>

The name of the logging bucket. Logging automatically creates two log buckets: _Required and _Default.

Link copied to clipboard

The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed.

Link copied to clipboard
val description: Output<String>

Describes this bucket.

Link copied to clipboard
val folder: Output<String>

The parent resource that contains the logging bucket.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

A list of indexed fields and related configuration data. Structure is documented below.

Link copied to clipboard
val lifecycleState: Output<String>

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

Link copied to clipboard
val location: Output<String>

The location of the bucket.

Link copied to clipboard
val name: Output<String>

The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val retentionDays: Output<Int>?

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.

Link copied to clipboard
val urn: Output<String>