Class BillingAccountBucketConfig


  • public class BillingAccountBucketConfig
    extends com.pulumi.resources.CustomResource
    Manages a billing account 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.OrganizationsFunctions; import com.pulumi.gcp.organizations.inputs.GetBillingAccountArgs; import com.pulumi.gcp.logging.BillingAccountBucketConfig; import com.pulumi.gcp.logging.BillingAccountBucketConfigArgs; 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) { final var default = OrganizationsFunctions.getBillingAccount(GetBillingAccountArgs.builder() .billingAccount("00AA00-000AAA-00AA0A") .build()); var basic = new BillingAccountBucketConfig("basic", BillingAccountBucketConfigArgs.builder() .billingAccount(default_.billingAccount()) .location("global") .retentionDays(30) .bucketId("_Default") .build()); } } ``` ## Import This resource can be imported using the following format: ```sh $ pulumi import gcp:logging/billingAccountBucketConfig:BillingAccountBucketConfig default billingAccounts/{{billingAccount}}/locations/{{location}}/buckets/{{bucket_id}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> billingAccount()  
      com.pulumi.core.Output<java.lang.String> bucketId()  
      com.pulumi.core.Output<java.util.Optional<BillingAccountBucketConfigCmekSettings>> cmekSettings()  
      com.pulumi.core.Output<java.lang.String> description()  
      static BillingAccountBucketConfig get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, BillingAccountBucketConfigState 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.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()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BillingAccountBucketConfig

        public BillingAccountBucketConfig​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • BillingAccountBucketConfig

        public BillingAccountBucketConfig​(java.lang.String name,
                                          BillingAccountBucketConfigArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • BillingAccountBucketConfig

        public BillingAccountBucketConfig​(java.lang.String name,
                                          BillingAccountBucketConfigArgs 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

      • billingAccount

        public com.pulumi.core.Output<java.lang.String> billingAccount()
        Returns:
        The parent resource that contains the logging bucket.
      • 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<BillingAccountBucketConfigCmekSettings>> 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.
      • 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: "projects/my-project-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 BillingAccountBucketConfig get​(java.lang.String name,
                                                     com.pulumi.core.Output<java.lang.String> id,
                                                     @Nullable
                                                     BillingAccountBucketConfigState 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.