1. Registry
  2. Packages
  3. Google Cloud (GCP)
  4. API Docs
  5. observability
  6. Bucket
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi

    Bucket configuration for storing observability data.

    Example Usage

    Create Bucket Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Bucket(name: string, args: BucketArgs, opts?: CustomResourceOptions);
    @overload
    def Bucket(resource_name: str,
               args: BucketArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Bucket(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               bucket_id: Optional[str] = None,
               location: Optional[str] = None,
               cmek_settings: Optional[BucketCmekSettingsArgs] = None,
               description: Optional[str] = None,
               display_name: Optional[str] = None,
               project: Optional[str] = None)
    func NewBucket(ctx *Context, name string, args BucketArgs, opts ...ResourceOption) (*Bucket, error)
    public Bucket(string name, BucketArgs args, CustomResourceOptions? opts = null)
    public Bucket(String name, BucketArgs args)
    public Bucket(String name, BucketArgs args, CustomResourceOptions options)
    
    type: gcp:observability:Bucket
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gcp_observability_bucket" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args BucketArgs
    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 BucketArgs
    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 BucketArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BucketArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BucketArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var bucketResource = new Gcp.Observability.Bucket("bucketResource", new()
    {
        BucketId = "string",
        Location = "string",
        CmekSettings = new Gcp.Observability.Inputs.BucketCmekSettingsArgs
        {
            KmsKey = "string",
            KmsKeyVersion = "string",
            ServiceAccountId = "string",
        },
        Description = "string",
        DisplayName = "string",
        Project = "string",
    });
    
    example, err := observability.NewBucket(ctx, "bucketResource", &observability.BucketArgs{
    	BucketId: pulumi.String("string"),
    	Location: pulumi.String("string"),
    	CmekSettings: &observability.BucketCmekSettingsArgs{
    		KmsKey:           pulumi.String("string"),
    		KmsKeyVersion:    pulumi.String("string"),
    		ServiceAccountId: pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	DisplayName: pulumi.String("string"),
    	Project:     pulumi.String("string"),
    })
    
    resource "gcp_observability_bucket" "bucketResource" {
      lifecycle {
        create_before_destroy = true
      }
      bucket_id = "string"
      location  = "string"
      cmek_settings = {
        kms_key            = "string"
        kms_key_version    = "string"
        service_account_id = "string"
      }
      description  = "string"
      display_name = "string"
      project      = "string"
    }
    
    var bucketResource = new com.pulumi.gcp.observability.Bucket("bucketResource", com.pulumi.gcp.observability.BucketArgs.builder()
        .bucketId("string")
        .location("string")
        .cmekSettings(BucketCmekSettingsArgs.builder()
            .kmsKey("string")
            .kmsKeyVersion("string")
            .serviceAccountId("string")
            .build())
        .description("string")
        .displayName("string")
        .project("string")
        .build());
    
    bucket_resource = gcp.observability.Bucket("bucketResource",
        bucket_id="string",
        location="string",
        cmek_settings={
            "kms_key": "string",
            "kms_key_version": "string",
            "service_account_id": "string",
        },
        description="string",
        display_name="string",
        project="string")
    
    const bucketResource = new gcp.observability.Bucket("bucketResource", {
        bucketId: "string",
        location: "string",
        cmekSettings: {
            kmsKey: "string",
            kmsKeyVersion: "string",
            serviceAccountId: "string",
        },
        description: "string",
        displayName: "string",
        project: "string",
    });
    
    type: gcp:observability:Bucket
    properties:
        bucketId: string
        cmekSettings:
            kmsKey: string
            kmsKeyVersion: string
            serviceAccountId: string
        description: string
        displayName: string
        location: string
        project: string
    

    Bucket Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Bucket resource accepts the following input properties:

    BucketId string
    A client-assigned identifier for the bucket.
    Location string
    The location of the bucket.
    CmekSettings BucketCmekSettings
    Settings for configuring CMEK for a bucket. Structure is documented below.
    Description string
    Description of the bucket.
    DisplayName string
    User friendly display name.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    BucketId string
    A client-assigned identifier for the bucket.
    Location string
    The location of the bucket.
    CmekSettings BucketCmekSettingsArgs
    Settings for configuring CMEK for a bucket. Structure is documented below.
    Description string
    Description of the bucket.
    DisplayName string
    User friendly display name.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    bucket_id string
    A client-assigned identifier for the bucket.
    location string
    The location of the bucket.
    cmek_settings object
    Settings for configuring CMEK for a bucket. Structure is documented below.
    description string
    Description of the bucket.
    display_name string
    User friendly display name.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    bucketId String
    A client-assigned identifier for the bucket.
    location String
    The location of the bucket.
    cmekSettings BucketCmekSettings
    Settings for configuring CMEK for a bucket. Structure is documented below.
    description String
    Description of the bucket.
    displayName String
    User friendly display name.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    bucketId string
    A client-assigned identifier for the bucket.
    location string
    The location of the bucket.
    cmekSettings BucketCmekSettings
    Settings for configuring CMEK for a bucket. Structure is documented below.
    description string
    Description of the bucket.
    displayName string
    User friendly display name.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    bucket_id str
    A client-assigned identifier for the bucket.
    location str
    The location of the bucket.
    cmek_settings BucketCmekSettingsArgs
    Settings for configuring CMEK for a bucket. Structure is documented below.
    description str
    Description of the bucket.
    display_name str
    User friendly display name.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    bucketId String
    A client-assigned identifier for the bucket.
    location String
    The location of the bucket.
    cmekSettings Property Map
    Settings for configuring CMEK for a bucket. Structure is documented below.
    description String
    Description of the bucket.
    displayName String
    User friendly display name.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Bucket resource produces the following output properties:

    CreateTime string
    Output only. Create timestamp.
    DeleteTime string
    Output only. Delete timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    PurgeTime string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    UpdateTime string
    Output only. Update timestamp.
    CreateTime string
    Output only. Create timestamp.
    DeleteTime string
    Output only. Delete timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    PurgeTime string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    UpdateTime string
    Output only. Update timestamp.
    create_time string
    Output only. Create timestamp.
    delete_time string
    Output only. Delete timestamp.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    purge_time string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    update_time string
    Output only. Update timestamp.
    createTime String
    Output only. Create timestamp.
    deleteTime String
    Output only. Delete timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    purgeTime String
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    updateTime String
    Output only. Update timestamp.
    createTime string
    Output only. Create timestamp.
    deleteTime string
    Output only. Delete timestamp.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    purgeTime string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    updateTime string
    Output only. Update timestamp.
    create_time str
    Output only. Create timestamp.
    delete_time str
    Output only. Delete timestamp.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    purge_time str
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    update_time str
    Output only. Update timestamp.
    createTime String
    Output only. Create timestamp.
    deleteTime String
    Output only. Delete timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    purgeTime String
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    updateTime String
    Output only. Update timestamp.

    Look up Existing Bucket Resource

    Get an existing Bucket 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?: BucketState, opts?: CustomResourceOptions): Bucket
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket_id: Optional[str] = None,
            cmek_settings: Optional[BucketCmekSettingsArgs] = None,
            create_time: Optional[str] = None,
            delete_time: Optional[str] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            purge_time: Optional[str] = None,
            update_time: Optional[str] = None) -> Bucket
    func GetBucket(ctx *Context, name string, id IDInput, state *BucketState, opts ...ResourceOption) (*Bucket, error)
    public static Bucket Get(string name, Input<string> id, BucketState? state, CustomResourceOptions? opts = null)
    public static Bucket get(String name, Output<String> id, BucketState state, CustomResourceOptions options)
    resources:  _:    type: gcp:observability:Bucket    get:      id: ${id}
    import {
      to = gcp_observability_bucket.example
      id = "${id}"
    }
    
    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.
    The following state arguments are supported:
    BucketId string
    A client-assigned identifier for the bucket.
    CmekSettings BucketCmekSettings
    Settings for configuring CMEK for a bucket. Structure is documented below.
    CreateTime string
    Output only. Create timestamp.
    DeleteTime string
    Output only. Delete timestamp.
    Description string
    Description of the bucket.
    DisplayName string
    User friendly display name.
    Location string
    The location of the bucket.
    Name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PurgeTime string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    UpdateTime string
    Output only. Update timestamp.
    BucketId string
    A client-assigned identifier for the bucket.
    CmekSettings BucketCmekSettingsArgs
    Settings for configuring CMEK for a bucket. Structure is documented below.
    CreateTime string
    Output only. Create timestamp.
    DeleteTime string
    Output only. Delete timestamp.
    Description string
    Description of the bucket.
    DisplayName string
    User friendly display name.
    Location string
    The location of the bucket.
    Name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PurgeTime string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    UpdateTime string
    Output only. Update timestamp.
    bucket_id string
    A client-assigned identifier for the bucket.
    cmek_settings object
    Settings for configuring CMEK for a bucket. Structure is documented below.
    create_time string
    Output only. Create timestamp.
    delete_time string
    Output only. Delete timestamp.
    description string
    Description of the bucket.
    display_name string
    User friendly display name.
    location string
    The location of the bucket.
    name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purge_time string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    update_time string
    Output only. Update timestamp.
    bucketId String
    A client-assigned identifier for the bucket.
    cmekSettings BucketCmekSettings
    Settings for configuring CMEK for a bucket. Structure is documented below.
    createTime String
    Output only. Create timestamp.
    deleteTime String
    Output only. Delete timestamp.
    description String
    Description of the bucket.
    displayName String
    User friendly display name.
    location String
    The location of the bucket.
    name String
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purgeTime String
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    updateTime String
    Output only. Update timestamp.
    bucketId string
    A client-assigned identifier for the bucket.
    cmekSettings BucketCmekSettings
    Settings for configuring CMEK for a bucket. Structure is documented below.
    createTime string
    Output only. Create timestamp.
    deleteTime string
    Output only. Delete timestamp.
    description string
    Description of the bucket.
    displayName string
    User friendly display name.
    location string
    The location of the bucket.
    name string
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purgeTime string
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    updateTime string
    Output only. Update timestamp.
    bucket_id str
    A client-assigned identifier for the bucket.
    cmek_settings BucketCmekSettingsArgs
    Settings for configuring CMEK for a bucket. Structure is documented below.
    create_time str
    Output only. Create timestamp.
    delete_time str
    Output only. Delete timestamp.
    description str
    Description of the bucket.
    display_name str
    User friendly display name.
    location str
    The location of the bucket.
    name str
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purge_time str
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    update_time str
    Output only. Update timestamp.
    bucketId String
    A client-assigned identifier for the bucket.
    cmekSettings Property Map
    Settings for configuring CMEK for a bucket. Structure is documented below.
    createTime String
    Output only. Create timestamp.
    deleteTime String
    Output only. Delete timestamp.
    description String
    Description of the bucket.
    displayName String
    User friendly display name.
    location String
    The location of the bucket.
    name String
    Identifier. Name of the bucket. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purgeTime String
    Output only. Timestamp when the bucket in soft-deleted state is purged.
    updateTime String
    Output only. Update timestamp.

    Supporting Types

    BucketCmekSettings, BucketCmekSettingsArgs

    KmsKey string
    The resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]
    KmsKeyVersion string
    (Output) The CryptoKeyVersion resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]
    ServiceAccountId string
    (Output) The service account used to access the key.
    KmsKey string
    The resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]
    KmsKeyVersion string
    (Output) The CryptoKeyVersion resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]
    ServiceAccountId string
    (Output) The service account used to access the key.
    kms_key string
    The resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]
    kms_key_version string
    (Output) The CryptoKeyVersion resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]
    service_account_id string
    (Output) The service account used to access the key.
    kmsKey String
    The resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]
    kmsKeyVersion String
    (Output) The CryptoKeyVersion resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]
    serviceAccountId String
    (Output) The service account used to access the key.
    kmsKey string
    The resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]
    kmsKeyVersion string
    (Output) The CryptoKeyVersion resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]
    serviceAccountId string
    (Output) The service account used to access the key.
    kms_key str
    The resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]
    kms_key_version str
    (Output) The CryptoKeyVersion resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]
    service_account_id str
    (Output) The service account used to access the key.
    kmsKey String
    The resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]
    kmsKeyVersion String
    (Output) The CryptoKeyVersion resource name for the configured Cloud KMS key. The format is: projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]
    serviceAccountId String
    (Output) The service account used to access the key.

    Import

    Bucket can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/buckets/{{bucket_id}}
    • {{project}}/{{location}}/{{bucket_id}}
    • {{location}}/{{bucket_id}}

    When using the pulumi import command, Bucket can be imported using one of the formats above. For example:

    $ pulumi import gcp:observability/bucket:Bucket default projects/{{project}}/locations/{{location}}/buckets/{{bucket_id}}
    $ pulumi import gcp:observability/bucket:Bucket default {{project}}/{{location}}/{{bucket_id}}
    $ pulumi import gcp:observability/bucket:Bucket default {{location}}/{{bucket_id}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.
    gcp logo
    Viewing docs for Google Cloud v10.2.0
    published on Tuesday, Oct 20, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial