Package com.pulumi.gcp.logging
Class FolderBucketConfig
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.logging.FolderBucketConfig
-
public class FolderBucketConfig extends com.pulumi.resources.CustomResource
Manages a folder-level logging bucket config. For more information see [the official logging documentation](https://cloud.google.com/logging/docs/) and [Storing Logs](https://cloud.google.com/logging/docs/storage). > **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 ```java 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 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() .filePath("jsonPayload.request.status") .type("INDEX_TYPE_STRING") .build()) .build()); } } ``` ## Import This resource can be imported using the following format* `folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import this resource using one of the formats above. For exampletf import { id = "folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}}" to = google_logging_folder_bucket_config.default } ```sh $ pulumi import gcp:logging/folderBucketConfig:FolderBucketConfig When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), this resource can be imported using one of the formats above. For example ``` ```sh $ pulumi import gcp:logging/folderBucketConfig:FolderBucketConfig default folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} ```
-
-
Constructor Summary
Constructors Constructor Description FolderBucketConfig(java.lang.String name)
FolderBucketConfig(java.lang.String name, FolderBucketConfigArgs args)
FolderBucketConfig(java.lang.String name, FolderBucketConfigArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>
bucketId()
com.pulumi.core.Output<java.util.Optional<FolderBucketConfigCmekSettings>>
cmekSettings()
com.pulumi.core.Output<java.lang.String>
description()
com.pulumi.core.Output<java.lang.String>
folder()
static FolderBucketConfig
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FolderBucketConfigState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.util.List<FolderBucketConfigIndexConfig>>>
indexConfigs()
com.pulumi.core.Output<java.lang.String>
lifecycleState()
com.pulumi.core.Output<java.lang.String>
location()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>
retentionDays()
-
-
-
Constructor Detail
-
FolderBucketConfig
public FolderBucketConfig(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
FolderBucketConfig
public FolderBucketConfig(java.lang.String name, FolderBucketConfigArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
FolderBucketConfig
public FolderBucketConfig(java.lang.String name, FolderBucketConfigArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
bucketId
public com.pulumi.core.Output<java.lang.String> bucketId()
- Returns:
- The name of the logging bucket. Logging automatically creates two log buckets: `_Required` and `_Default`.
-
cmekSettings
public com.pulumi.core.Output<java.util.Optional<FolderBucketConfigCmekSettings>> cmekSettings()
- Returns:
- 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.
-
description
public com.pulumi.core.Output<java.lang.String> description()
- Returns:
- Describes this bucket.
-
folder
public com.pulumi.core.Output<java.lang.String> folder()
- Returns:
- The parent resource that contains the logging bucket.
-
indexConfigs
public com.pulumi.core.Output<java.util.Optional<java.util.List<FolderBucketConfigIndexConfig>>> indexConfigs()
- Returns:
- A list of indexed fields and related configuration data. Structure is documented below.
-
lifecycleState
public com.pulumi.core.Output<java.lang.String> lifecycleState()
- Returns:
- The bucket's lifecycle such as active or deleted. See [LifecycleState](https://cloud.google.com/logging/docs/reference/v2/rest/v2/billingAccounts.buckets#LogBucket.LifecycleState).
-
location
public com.pulumi.core.Output<java.lang.String> location()
- Returns:
- The location of the bucket.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"
-
retentionDays
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> retentionDays()
- Returns:
- 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.
-
get
public static FolderBucketConfig get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable FolderBucketConfigState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-