Google Cloud Classic v6.57.0, May 30 23
Google Cloud Classic v6.57.0, May 30 23
gcp.logging.BillingAccountBucketConfig
Explore with Pulumi AI
Manages a billing account 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
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = Gcp.Organizations.GetBillingAccount.Invoke(new()
{
BillingAccount = "00AA00-000AAA-00AA0A",
});
var basic = new Gcp.Logging.BillingAccountBucketConfig("basic", new()
{
BillingAccount = @default.Apply(@default => @default.Apply(getBillingAccountResult => getBillingAccountResult.BillingAccount)),
Location = "global",
RetentionDays = 30,
BucketId = "_Default",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/logging"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := organizations.GetBillingAccount(ctx, &organizations.GetBillingAccountArgs{
BillingAccount: pulumi.StringRef("00AA00-000AAA-00AA0A"),
}, nil)
if err != nil {
return err
}
_, err = logging.NewBillingAccountBucketConfig(ctx, "basic", &logging.BillingAccountBucketConfigArgs{
BillingAccount: *pulumi.String(_default.BillingAccount),
Location: pulumi.String("global"),
RetentionDays: pulumi.Int(30),
BucketId: pulumi.String("_Default"),
})
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.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 pulumi
import pulumi_gcp as gcp
default = gcp.organizations.get_billing_account(billing_account="00AA00-000AAA-00AA0A")
basic = gcp.logging.BillingAccountBucketConfig("basic",
billing_account=default.billing_account,
location="global",
retention_days=30,
bucket_id="_Default")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const default = gcp.organizations.getBillingAccount({
billingAccount: "00AA00-000AAA-00AA0A",
});
const basic = new gcp.logging.BillingAccountBucketConfig("basic", {
billingAccount: _default.then(_default => _default.billingAccount),
location: "global",
retentionDays: 30,
bucketId: "_Default",
});
resources:
basic:
type: gcp:logging:BillingAccountBucketConfig
properties:
billingAccount: ${default.billingAccount}
location: global
retentionDays: 30
bucketId: _Default
variables:
default:
fn::invoke:
Function: gcp:organizations:getBillingAccount
Arguments:
billingAccount: 00AA00-000AAA-00AA0A
Create BillingAccountBucketConfig Resource
new BillingAccountBucketConfig(name: string, args: BillingAccountBucketConfigArgs, opts?: CustomResourceOptions);
@overload
def BillingAccountBucketConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
billing_account: Optional[str] = None,
bucket_id: Optional[str] = None,
cmek_settings: Optional[BillingAccountBucketConfigCmekSettingsArgs] = None,
description: Optional[str] = None,
location: Optional[str] = None,
retention_days: Optional[int] = None)
@overload
def BillingAccountBucketConfig(resource_name: str,
args: BillingAccountBucketConfigArgs,
opts: Optional[ResourceOptions] = None)
func NewBillingAccountBucketConfig(ctx *Context, name string, args BillingAccountBucketConfigArgs, opts ...ResourceOption) (*BillingAccountBucketConfig, error)
public BillingAccountBucketConfig(string name, BillingAccountBucketConfigArgs args, CustomResourceOptions? opts = null)
public BillingAccountBucketConfig(String name, BillingAccountBucketConfigArgs args)
public BillingAccountBucketConfig(String name, BillingAccountBucketConfigArgs args, CustomResourceOptions options)
type: gcp:logging:BillingAccountBucketConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BillingAccountBucketConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args BillingAccountBucketConfigArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BillingAccountBucketConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BillingAccountBucketConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BillingAccountBucketConfigArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
BillingAccountBucketConfig Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The BillingAccountBucketConfig resource accepts the following input properties:
- Billing
Account string The parent resource that contains the logging bucket.
- Bucket
Id string The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- Location string
The location of the bucket.
- Cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 string
Describes this bucket.
- Retention
Days 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.
- Billing
Account string The parent resource that contains the logging bucket.
- Bucket
Id string The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- Location string
The location of the bucket.
- Cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 string
Describes this bucket.
- Retention
Days 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.
- billing
Account String The parent resource that contains the logging bucket.
- bucket
Id String The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- location String
The location of the bucket.
- cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 String
Describes this bucket.
- retention
Days Integer 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.
- billing
Account string The parent resource that contains the logging bucket.
- bucket
Id string The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- location string
The location of the bucket.
- cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 string
Describes this bucket.
- retention
Days number 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.
- billing_
account str The parent resource that contains the logging bucket.
- bucket_
id str The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- location str
The location of the bucket.
- cmek_
settings BillingAccount Bucket Config Cmek Settings Args 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 str
Describes this bucket.
- retention_
days 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.
- billing
Account String The parent resource that contains the logging bucket.
- bucket
Id String The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- location String
The location of the bucket.
- cmek
Settings Property Map 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 String
Describes this bucket.
- retention
Days Number 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the BillingAccountBucketConfig resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Lifecycle
State string The bucket's lifecycle such as active or deleted. See LifecycleState.
- Name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- Id string
The provider-assigned unique ID for this managed resource.
- Lifecycle
State string The bucket's lifecycle such as active or deleted. See LifecycleState.
- Name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- id String
The provider-assigned unique ID for this managed resource.
- lifecycle
State String The bucket's lifecycle such as active or deleted. See LifecycleState.
- name String
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- id string
The provider-assigned unique ID for this managed resource.
- lifecycle
State string The bucket's lifecycle such as active or deleted. See LifecycleState.
- name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- id str
The provider-assigned unique ID for this managed resource.
- lifecycle_
state str The bucket's lifecycle such as active or deleted. See LifecycleState.
- name str
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- id String
The provider-assigned unique ID for this managed resource.
- lifecycle
State String The bucket's lifecycle such as active or deleted. See LifecycleState.
- name String
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
Look up Existing BillingAccountBucketConfig Resource
Get an existing BillingAccountBucketConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: BillingAccountBucketConfigState, opts?: CustomResourceOptions): BillingAccountBucketConfig
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
billing_account: Optional[str] = None,
bucket_id: Optional[str] = None,
cmek_settings: Optional[BillingAccountBucketConfigCmekSettingsArgs] = None,
description: Optional[str] = None,
lifecycle_state: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
retention_days: Optional[int] = None) -> BillingAccountBucketConfig
func GetBillingAccountBucketConfig(ctx *Context, name string, id IDInput, state *BillingAccountBucketConfigState, opts ...ResourceOption) (*BillingAccountBucketConfig, error)
public static BillingAccountBucketConfig Get(string name, Input<string> id, BillingAccountBucketConfigState? state, CustomResourceOptions? opts = null)
public static BillingAccountBucketConfig get(String name, Output<String> id, BillingAccountBucketConfigState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Billing
Account string The parent resource that contains the logging bucket.
- Bucket
Id string The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- Cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 string
Describes this bucket.
- Lifecycle
State string The bucket's lifecycle such as active or deleted. See LifecycleState.
- Location string
The location of the bucket.
- Name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- Retention
Days 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.
- Billing
Account string The parent resource that contains the logging bucket.
- Bucket
Id string The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- Cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 string
Describes this bucket.
- Lifecycle
State string The bucket's lifecycle such as active or deleted. See LifecycleState.
- Location string
The location of the bucket.
- Name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- Retention
Days 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.
- billing
Account String The parent resource that contains the logging bucket.
- bucket
Id String The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 String
Describes this bucket.
- lifecycle
State String The bucket's lifecycle such as active or deleted. See LifecycleState.
- location String
The location of the bucket.
- name String
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- retention
Days Integer 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.
- billing
Account string The parent resource that contains the logging bucket.
- bucket
Id string The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- cmek
Settings BillingAccount Bucket Config Cmek Settings Args 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 string
Describes this bucket.
- lifecycle
State string The bucket's lifecycle such as active or deleted. See LifecycleState.
- location string
The location of the bucket.
- name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- retention
Days number 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.
- billing_
account str The parent resource that contains the logging bucket.
- bucket_
id str The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- cmek_
settings BillingAccount Bucket Config Cmek Settings Args 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 str
Describes this bucket.
- lifecycle_
state str The bucket's lifecycle such as active or deleted. See LifecycleState.
- location str
The location of the bucket.
- name str
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- retention_
days 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.
- billing
Account String The parent resource that contains the logging bucket.
- bucket
Id String The name of the logging bucket. Logging automatically creates two log buckets:
_Required
and_Default
.- cmek
Settings Property Map 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 String
Describes this bucket.
- lifecycle
State String The bucket's lifecycle such as active or deleted. See LifecycleState.
- location String
The location of the bucket.
- name String
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- retention
Days Number 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.
Supporting Types
BillingAccountBucketConfigCmekSettings
- Kms
Key stringName - Kms
Key stringVersion Name - Name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- Service
Account stringId
- Kms
Key stringName - Kms
Key stringVersion Name - Name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- Service
Account stringId
- kms
Key StringName - kms
Key StringVersion Name - name String
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- service
Account StringId
- kms
Key stringName - kms
Key stringVersion Name - name string
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- service
Account stringId
- kms_
key_ strname - kms_
key_ strversion_ name - name str
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- service_
account_ strid
- kms
Key StringName - kms
Key StringVersion Name - name String
The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"
- service
Account StringId
Import
This resource can be imported using the following format
$ pulumi import gcp:logging/billingAccountBucketConfig:BillingAccountBucketConfig default billingAccounts/{{billingAccount}}/locations/{{location}}/buckets/{{bucket_id}}
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.