FolderBucketConfig class
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/v9/go/gcp/logging"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, 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
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_organizations_folder" "default" {
display_name = "some-folder-name"
parent = "organizations/123456789"
}
resource "gcp_logging_folderbucketconfig" "basic" {
folder = gcp_organizations_folder.default.name
location = "global"
retention_days = 30
bucket_id = "_Default"
index_configs {
field_path = "jsonPayload.request.status"
type = "INDEX_TYPE_STRING"
}
}
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.ArrayList;
import java.util.Arrays;
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}}
Constructors
- FolderBucketConfig(String name, {FolderBucketConfigArgs? args, CustomResourceOptions? options})
-
Creates a new FolderBucketConfig.
nameThe Pulumi resource name.argsArguments used to configure this FolderBucketConfig. The set of arguments for FolderBucketConfig.optionsResource options controlling this resource's behavior. - FolderBucketConfig.reference(String urn)
- Creates a typed reference to an existing FolderBucketConfig resource.
Properties
-
bucketId
↔ Output<
String> -
The name of the logging bucket. Logging automatically creates two log buckets:
_Requiredand_Default.latefinal -
childResources
→ Set<
Resource> -
finalinherited
-
cmekSettings
↔ Output<
FolderBucketConfigCmekSettings?> -
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.
latefinal
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to "DELETE".
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
-
description
↔ Output<
String> -
Describes this bucket.
latefinal
-
folder
↔ Output<
String> -
The parent resource that contains the logging bucket.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
indexConfigs
↔ Output<
List< FolderBucketConfigIndexConfig> > -
A list of indexed fields and related configuration data. Structure is documented below.
latefinal
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
lifecycleState
↔ Output<
String> -
The bucket's lifecycle such as active or deleted. See LifecycleState.
latefinal
-
location
↔ Output<
String> -
The location of the bucket.
latefinal
-
name
↔ Output<
String> -
The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
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.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {FolderBucketConfigState? state, CustomResourceOptions? options}) → FolderBucketConfig -
Gets an existing FolderBucketConfig resource's state with the given
nameandid.