1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. storage
  5. Bucket
Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 2024 by Pulumi

gcp.storage.Bucket

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Creates a new bucket in Google cloud storage service (GCS). Once a bucket has been created, its location can’t be changed.

    For more information see the official documentation and API.

    Note: If the project id is not set on the resource or in the provider block it will be dynamically determined which will require enabling the compute api.

    Example Usage

    Creating A Private Bucket In Standard Storage, In The EU Region. Bucket Configured As Static Website And CORS Configurations

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const static_site = new gcp.storage.Bucket("static-site", {
        name: "image-store.com",
        location: "EU",
        forceDestroy: true,
        uniformBucketLevelAccess: true,
        website: {
            mainPageSuffix: "index.html",
            notFoundPage: "404.html",
        },
        cors: [{
            origins: ["http://image-store.com"],
            methods: [
                "GET",
                "HEAD",
                "PUT",
                "POST",
                "DELETE",
            ],
            responseHeaders: ["*"],
            maxAgeSeconds: 3600,
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    static_site = gcp.storage.Bucket("static-site",
        name="image-store.com",
        location="EU",
        force_destroy=True,
        uniform_bucket_level_access=True,
        website=gcp.storage.BucketWebsiteArgs(
            main_page_suffix="index.html",
            not_found_page="404.html",
        ),
        cors=[gcp.storage.BucketCorArgs(
            origins=["http://image-store.com"],
            methods=[
                "GET",
                "HEAD",
                "PUT",
                "POST",
                "DELETE",
            ],
            response_headers=["*"],
            max_age_seconds=3600,
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := storage.NewBucket(ctx, "static-site", &storage.BucketArgs{
    			Name:                     pulumi.String("image-store.com"),
    			Location:                 pulumi.String("EU"),
    			ForceDestroy:             pulumi.Bool(true),
    			UniformBucketLevelAccess: pulumi.Bool(true),
    			Website: &storage.BucketWebsiteArgs{
    				MainPageSuffix: pulumi.String("index.html"),
    				NotFoundPage:   pulumi.String("404.html"),
    			},
    			Cors: storage.BucketCorArray{
    				&storage.BucketCorArgs{
    					Origins: pulumi.StringArray{
    						pulumi.String("http://image-store.com"),
    					},
    					Methods: pulumi.StringArray{
    						pulumi.String("GET"),
    						pulumi.String("HEAD"),
    						pulumi.String("PUT"),
    						pulumi.String("POST"),
    						pulumi.String("DELETE"),
    					},
    					ResponseHeaders: pulumi.StringArray{
    						pulumi.String("*"),
    					},
    					MaxAgeSeconds: pulumi.Int(3600),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var static_site = new Gcp.Storage.Bucket("static-site", new()
        {
            Name = "image-store.com",
            Location = "EU",
            ForceDestroy = true,
            UniformBucketLevelAccess = true,
            Website = new Gcp.Storage.Inputs.BucketWebsiteArgs
            {
                MainPageSuffix = "index.html",
                NotFoundPage = "404.html",
            },
            Cors = new[]
            {
                new Gcp.Storage.Inputs.BucketCorArgs
                {
                    Origins = new[]
                    {
                        "http://image-store.com",
                    },
                    Methods = new[]
                    {
                        "GET",
                        "HEAD",
                        "PUT",
                        "POST",
                        "DELETE",
                    },
                    ResponseHeaders = new[]
                    {
                        "*",
                    },
                    MaxAgeSeconds = 3600,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.storage.Bucket;
    import com.pulumi.gcp.storage.BucketArgs;
    import com.pulumi.gcp.storage.inputs.BucketWebsiteArgs;
    import com.pulumi.gcp.storage.inputs.BucketCorArgs;
    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 static_site = new Bucket("static-site", BucketArgs.builder()        
                .name("image-store.com")
                .location("EU")
                .forceDestroy(true)
                .uniformBucketLevelAccess(true)
                .website(BucketWebsiteArgs.builder()
                    .mainPageSuffix("index.html")
                    .notFoundPage("404.html")
                    .build())
                .cors(BucketCorArgs.builder()
                    .origins("http://image-store.com")
                    .methods(                
                        "GET",
                        "HEAD",
                        "PUT",
                        "POST",
                        "DELETE")
                    .responseHeaders("*")
                    .maxAgeSeconds(3600)
                    .build())
                .build());
    
        }
    }
    
    resources:
      static-site:
        type: gcp:storage:Bucket
        properties:
          name: image-store.com
          location: EU
          forceDestroy: true
          uniformBucketLevelAccess: true
          website:
            mainPageSuffix: index.html
            notFoundPage: 404.html
          cors:
            - origins:
                - http://image-store.com
              methods:
                - GET
                - HEAD
                - PUT
                - POST
                - DELETE
              responseHeaders:
                - '*'
              maxAgeSeconds: 3600
    

    Life Cycle Settings For Storage Bucket Objects

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const auto_expire = new gcp.storage.Bucket("auto-expire", {
        name: "auto-expiring-bucket",
        location: "US",
        forceDestroy: true,
        lifecycleRules: [
            {
                condition: {
                    age: 3,
                },
                action: {
                    type: "Delete",
                },
            },
            {
                condition: {
                    age: 1,
                },
                action: {
                    type: "AbortIncompleteMultipartUpload",
                },
            },
        ],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    auto_expire = gcp.storage.Bucket("auto-expire",
        name="auto-expiring-bucket",
        location="US",
        force_destroy=True,
        lifecycle_rules=[
            gcp.storage.BucketLifecycleRuleArgs(
                condition=gcp.storage.BucketLifecycleRuleConditionArgs(
                    age=3,
                ),
                action=gcp.storage.BucketLifecycleRuleActionArgs(
                    type="Delete",
                ),
            ),
            gcp.storage.BucketLifecycleRuleArgs(
                condition=gcp.storage.BucketLifecycleRuleConditionArgs(
                    age=1,
                ),
                action=gcp.storage.BucketLifecycleRuleActionArgs(
                    type="AbortIncompleteMultipartUpload",
                ),
            ),
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := storage.NewBucket(ctx, "auto-expire", &storage.BucketArgs{
    			Name:         pulumi.String("auto-expiring-bucket"),
    			Location:     pulumi.String("US"),
    			ForceDestroy: pulumi.Bool(true),
    			LifecycleRules: storage.BucketLifecycleRuleArray{
    				&storage.BucketLifecycleRuleArgs{
    					Condition: &storage.BucketLifecycleRuleConditionArgs{
    						Age: pulumi.Int(3),
    					},
    					Action: &storage.BucketLifecycleRuleActionArgs{
    						Type: pulumi.String("Delete"),
    					},
    				},
    				&storage.BucketLifecycleRuleArgs{
    					Condition: &storage.BucketLifecycleRuleConditionArgs{
    						Age: pulumi.Int(1),
    					},
    					Action: &storage.BucketLifecycleRuleActionArgs{
    						Type: pulumi.String("AbortIncompleteMultipartUpload"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var auto_expire = new Gcp.Storage.Bucket("auto-expire", new()
        {
            Name = "auto-expiring-bucket",
            Location = "US",
            ForceDestroy = true,
            LifecycleRules = new[]
            {
                new Gcp.Storage.Inputs.BucketLifecycleRuleArgs
                {
                    Condition = new Gcp.Storage.Inputs.BucketLifecycleRuleConditionArgs
                    {
                        Age = 3,
                    },
                    Action = new Gcp.Storage.Inputs.BucketLifecycleRuleActionArgs
                    {
                        Type = "Delete",
                    },
                },
                new Gcp.Storage.Inputs.BucketLifecycleRuleArgs
                {
                    Condition = new Gcp.Storage.Inputs.BucketLifecycleRuleConditionArgs
                    {
                        Age = 1,
                    },
                    Action = new Gcp.Storage.Inputs.BucketLifecycleRuleActionArgs
                    {
                        Type = "AbortIncompleteMultipartUpload",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.storage.Bucket;
    import com.pulumi.gcp.storage.BucketArgs;
    import com.pulumi.gcp.storage.inputs.BucketLifecycleRuleArgs;
    import com.pulumi.gcp.storage.inputs.BucketLifecycleRuleConditionArgs;
    import com.pulumi.gcp.storage.inputs.BucketLifecycleRuleActionArgs;
    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 auto_expire = new Bucket("auto-expire", BucketArgs.builder()        
                .name("auto-expiring-bucket")
                .location("US")
                .forceDestroy(true)
                .lifecycleRules(            
                    BucketLifecycleRuleArgs.builder()
                        .condition(BucketLifecycleRuleConditionArgs.builder()
                            .age(3)
                            .build())
                        .action(BucketLifecycleRuleActionArgs.builder()
                            .type("Delete")
                            .build())
                        .build(),
                    BucketLifecycleRuleArgs.builder()
                        .condition(BucketLifecycleRuleConditionArgs.builder()
                            .age(1)
                            .build())
                        .action(BucketLifecycleRuleActionArgs.builder()
                            .type("AbortIncompleteMultipartUpload")
                            .build())
                        .build())
                .build());
    
        }
    }
    
    resources:
      auto-expire:
        type: gcp:storage:Bucket
        properties:
          name: auto-expiring-bucket
          location: US
          forceDestroy: true
          lifecycleRules:
            - condition:
                age: 3
              action:
                type: Delete
            - condition:
                age: 1
              action:
                type: AbortIncompleteMultipartUpload
    

    Enabling Public Access Prevention

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const auto_expire = new gcp.storage.Bucket("auto-expire", {
        name: "no-public-access-bucket",
        location: "US",
        forceDestroy: true,
        publicAccessPrevention: "enforced",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    auto_expire = gcp.storage.Bucket("auto-expire",
        name="no-public-access-bucket",
        location="US",
        force_destroy=True,
        public_access_prevention="enforced")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := storage.NewBucket(ctx, "auto-expire", &storage.BucketArgs{
    			Name:                   pulumi.String("no-public-access-bucket"),
    			Location:               pulumi.String("US"),
    			ForceDestroy:           pulumi.Bool(true),
    			PublicAccessPrevention: pulumi.String("enforced"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var auto_expire = new Gcp.Storage.Bucket("auto-expire", new()
        {
            Name = "no-public-access-bucket",
            Location = "US",
            ForceDestroy = true,
            PublicAccessPrevention = "enforced",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.storage.Bucket;
    import com.pulumi.gcp.storage.BucketArgs;
    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 auto_expire = new Bucket("auto-expire", BucketArgs.builder()        
                .name("no-public-access-bucket")
                .location("US")
                .forceDestroy(true)
                .publicAccessPrevention("enforced")
                .build());
    
        }
    }
    
    resources:
      auto-expire:
        type: gcp:storage:Bucket
        properties:
          name: no-public-access-bucket
          location: US
          forceDestroy: true
          publicAccessPrevention: enforced
    

    Create Bucket Resource

    new Bucket(name: string, args: BucketArgs, opts?: CustomResourceOptions);
    @overload
    def Bucket(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               autoclass: Optional[BucketAutoclassArgs] = None,
               cors: Optional[Sequence[BucketCorArgs]] = None,
               custom_placement_config: Optional[BucketCustomPlacementConfigArgs] = None,
               default_event_based_hold: Optional[bool] = None,
               enable_object_retention: Optional[bool] = None,
               encryption: Optional[BucketEncryptionArgs] = None,
               force_destroy: Optional[bool] = None,
               labels: Optional[Mapping[str, str]] = None,
               lifecycle_rules: Optional[Sequence[BucketLifecycleRuleArgs]] = None,
               location: Optional[str] = None,
               logging: Optional[BucketLoggingArgs] = None,
               name: Optional[str] = None,
               project: Optional[str] = None,
               public_access_prevention: Optional[str] = None,
               requester_pays: Optional[bool] = None,
               retention_policy: Optional[BucketRetentionPolicyArgs] = None,
               rpo: Optional[str] = None,
               soft_delete_policy: Optional[BucketSoftDeletePolicyArgs] = None,
               storage_class: Optional[str] = None,
               uniform_bucket_level_access: Optional[bool] = None,
               versioning: Optional[BucketVersioningArgs] = None,
               website: Optional[BucketWebsiteArgs] = None)
    @overload
    def Bucket(resource_name: str,
               args: BucketArgs,
               opts: Optional[ResourceOptions] = 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:storage:Bucket
    properties: # The arguments to resource properties.
    options: # 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.
    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.

    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

    The Bucket resource accepts the following input properties:

    Location string
    The GCS location.


    Autoclass BucketAutoclass
    The bucket's Autoclass configuration. Structure is documented below.
    Cors List<BucketCor>
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    CustomPlacementConfig BucketCustomPlacementConfig
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    DefaultEventBasedHold bool
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    EnableObjectRetention bool
    Enables object retention on a storage bucket.
    Encryption BucketEncryption
    The bucket's encryption configuration. Structure is documented below.
    ForceDestroy bool
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    Labels Dictionary<string, string>
    A map of key/value label pairs to assign to the bucket.
    LifecycleRules List<BucketLifecycleRule>
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    Logging BucketLogging
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    Name string
    The name of the bucket.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PublicAccessPrevention string
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    RequesterPays bool
    Enables Requester Pays on a storage bucket.
    RetentionPolicy BucketRetentionPolicy
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    Rpo string
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    SoftDeletePolicy BucketSoftDeletePolicy
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    StorageClass string
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    UniformBucketLevelAccess bool
    Enables Uniform bucket-level access access to a bucket.
    Versioning BucketVersioning
    The bucket's Versioning configuration. Structure is documented below.
    Website BucketWebsite
    Configuration if the bucket acts as a website. Structure is documented below.
    Location string
    The GCS location.


    Autoclass BucketAutoclassArgs
    The bucket's Autoclass configuration. Structure is documented below.
    Cors []BucketCorArgs
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    CustomPlacementConfig BucketCustomPlacementConfigArgs
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    DefaultEventBasedHold bool
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    EnableObjectRetention bool
    Enables object retention on a storage bucket.
    Encryption BucketEncryptionArgs
    The bucket's encryption configuration. Structure is documented below.
    ForceDestroy bool
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    Labels map[string]string
    A map of key/value label pairs to assign to the bucket.
    LifecycleRules []BucketLifecycleRuleArgs
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    Logging BucketLoggingArgs
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    Name string
    The name of the bucket.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PublicAccessPrevention string
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    RequesterPays bool
    Enables Requester Pays on a storage bucket.
    RetentionPolicy BucketRetentionPolicyArgs
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    Rpo string
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    SoftDeletePolicy BucketSoftDeletePolicyArgs
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    StorageClass string
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    UniformBucketLevelAccess bool
    Enables Uniform bucket-level access access to a bucket.
    Versioning BucketVersioningArgs
    The bucket's Versioning configuration. Structure is documented below.
    Website BucketWebsiteArgs
    Configuration if the bucket acts as a website. Structure is documented below.
    location String
    The GCS location.


    autoclass BucketAutoclass
    The bucket's Autoclass configuration. Structure is documented below.
    cors List<BucketCor>
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    customPlacementConfig BucketCustomPlacementConfig
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    defaultEventBasedHold Boolean
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    enableObjectRetention Boolean
    Enables object retention on a storage bucket.
    encryption BucketEncryption
    The bucket's encryption configuration. Structure is documented below.
    forceDestroy Boolean
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels Map<String,String>
    A map of key/value label pairs to assign to the bucket.
    lifecycleRules List<BucketLifecycleRule>
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    logging BucketLogging
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name String
    The name of the bucket.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    publicAccessPrevention String
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    requesterPays Boolean
    Enables Requester Pays on a storage bucket.
    retentionPolicy BucketRetentionPolicy
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo String
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    softDeletePolicy BucketSoftDeletePolicy
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storageClass String
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniformBucketLevelAccess Boolean
    Enables Uniform bucket-level access access to a bucket.
    versioning BucketVersioning
    The bucket's Versioning configuration. Structure is documented below.
    website BucketWebsite
    Configuration if the bucket acts as a website. Structure is documented below.
    location string
    The GCS location.


    autoclass BucketAutoclass
    The bucket's Autoclass configuration. Structure is documented below.
    cors BucketCor[]
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    customPlacementConfig BucketCustomPlacementConfig
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    defaultEventBasedHold boolean
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    enableObjectRetention boolean
    Enables object retention on a storage bucket.
    encryption BucketEncryption
    The bucket's encryption configuration. Structure is documented below.
    forceDestroy boolean
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels {[key: string]: string}
    A map of key/value label pairs to assign to the bucket.
    lifecycleRules BucketLifecycleRule[]
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    logging BucketLogging
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name string
    The name of the bucket.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    publicAccessPrevention string
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    requesterPays boolean
    Enables Requester Pays on a storage bucket.
    retentionPolicy BucketRetentionPolicy
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo string
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    softDeletePolicy BucketSoftDeletePolicy
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storageClass string
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniformBucketLevelAccess boolean
    Enables Uniform bucket-level access access to a bucket.
    versioning BucketVersioning
    The bucket's Versioning configuration. Structure is documented below.
    website BucketWebsite
    Configuration if the bucket acts as a website. Structure is documented below.
    location str
    The GCS location.


    autoclass BucketAutoclassArgs
    The bucket's Autoclass configuration. Structure is documented below.
    cors Sequence[BucketCorArgs]
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    custom_placement_config BucketCustomPlacementConfigArgs
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    default_event_based_hold bool
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    enable_object_retention bool
    Enables object retention on a storage bucket.
    encryption BucketEncryptionArgs
    The bucket's encryption configuration. Structure is documented below.
    force_destroy bool
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels Mapping[str, str]
    A map of key/value label pairs to assign to the bucket.
    lifecycle_rules Sequence[BucketLifecycleRuleArgs]
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    logging BucketLoggingArgs
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name str
    The name of the bucket.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    public_access_prevention str
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    requester_pays bool
    Enables Requester Pays on a storage bucket.
    retention_policy BucketRetentionPolicyArgs
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo str
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    soft_delete_policy BucketSoftDeletePolicyArgs
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storage_class str
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniform_bucket_level_access bool
    Enables Uniform bucket-level access access to a bucket.
    versioning BucketVersioningArgs
    The bucket's Versioning configuration. Structure is documented below.
    website BucketWebsiteArgs
    Configuration if the bucket acts as a website. Structure is documented below.
    location String
    The GCS location.


    autoclass Property Map
    The bucket's Autoclass configuration. Structure is documented below.
    cors List<Property Map>
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    customPlacementConfig Property Map
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    defaultEventBasedHold Boolean
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    enableObjectRetention Boolean
    Enables object retention on a storage bucket.
    encryption Property Map
    The bucket's encryption configuration. Structure is documented below.
    forceDestroy Boolean
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels Map<String>
    A map of key/value label pairs to assign to the bucket.
    lifecycleRules List<Property Map>
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    logging Property Map
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name String
    The name of the bucket.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    publicAccessPrevention String
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    requesterPays Boolean
    Enables Requester Pays on a storage bucket.
    retentionPolicy Property Map
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo String
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    softDeletePolicy Property Map
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storageClass String
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniformBucketLevelAccess Boolean
    Enables Uniform bucket-level access access to a bucket.
    versioning Property Map
    The bucket's Versioning configuration. Structure is documented below.
    website Property Map
    Configuration if the bucket acts as a website. Structure is documented below.

    Outputs

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

    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    SelfLink string
    The URI of the created resource.
    Url string
    The base URL of the bucket, in the format gs://<bucket-name>.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    SelfLink string
    The URI of the created resource.
    Url string
    The base URL of the bucket, in the format gs://<bucket-name>.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    selfLink String
    The URI of the created resource.
    url String
    The base URL of the bucket, in the format gs://<bucket-name>.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    id string
    The provider-assigned unique ID for this managed resource.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    selfLink string
    The URI of the created resource.
    url string
    The base URL of the bucket, in the format gs://<bucket-name>.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    id str
    The provider-assigned unique ID for this managed resource.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    self_link str
    The URI of the created resource.
    url str
    The base URL of the bucket, in the format gs://<bucket-name>.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    selfLink String
    The URI of the created resource.
    url String
    The base URL of the bucket, in the format gs://<bucket-name>.

    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,
            autoclass: Optional[BucketAutoclassArgs] = None,
            cors: Optional[Sequence[BucketCorArgs]] = None,
            custom_placement_config: Optional[BucketCustomPlacementConfigArgs] = None,
            default_event_based_hold: Optional[bool] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            enable_object_retention: Optional[bool] = None,
            encryption: Optional[BucketEncryptionArgs] = None,
            force_destroy: Optional[bool] = None,
            labels: Optional[Mapping[str, str]] = None,
            lifecycle_rules: Optional[Sequence[BucketLifecycleRuleArgs]] = None,
            location: Optional[str] = None,
            logging: Optional[BucketLoggingArgs] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            public_access_prevention: Optional[str] = None,
            pulumi_labels: Optional[Mapping[str, str]] = None,
            requester_pays: Optional[bool] = None,
            retention_policy: Optional[BucketRetentionPolicyArgs] = None,
            rpo: Optional[str] = None,
            self_link: Optional[str] = None,
            soft_delete_policy: Optional[BucketSoftDeletePolicyArgs] = None,
            storage_class: Optional[str] = None,
            uniform_bucket_level_access: Optional[bool] = None,
            url: Optional[str] = None,
            versioning: Optional[BucketVersioningArgs] = None,
            website: Optional[BucketWebsiteArgs] = 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)
    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.
    The following state arguments are supported:
    Autoclass BucketAutoclass
    The bucket's Autoclass configuration. Structure is documented below.
    Cors List<BucketCor>
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    CustomPlacementConfig BucketCustomPlacementConfig
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    DefaultEventBasedHold bool
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    EnableObjectRetention bool
    Enables object retention on a storage bucket.
    Encryption BucketEncryption
    The bucket's encryption configuration. Structure is documented below.
    ForceDestroy bool
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    Labels Dictionary<string, string>
    A map of key/value label pairs to assign to the bucket.
    LifecycleRules List<BucketLifecycleRule>
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    Location string
    The GCS location.


    Logging BucketLogging
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    Name string
    The name of the bucket.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PublicAccessPrevention string
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    RequesterPays bool
    Enables Requester Pays on a storage bucket.
    RetentionPolicy BucketRetentionPolicy
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    Rpo string
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    SelfLink string
    The URI of the created resource.
    SoftDeletePolicy BucketSoftDeletePolicy
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    StorageClass string
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    UniformBucketLevelAccess bool
    Enables Uniform bucket-level access access to a bucket.
    Url string
    The base URL of the bucket, in the format gs://<bucket-name>.
    Versioning BucketVersioning
    The bucket's Versioning configuration. Structure is documented below.
    Website BucketWebsite
    Configuration if the bucket acts as a website. Structure is documented below.
    Autoclass BucketAutoclassArgs
    The bucket's Autoclass configuration. Structure is documented below.
    Cors []BucketCorArgs
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    CustomPlacementConfig BucketCustomPlacementConfigArgs
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    DefaultEventBasedHold bool
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    EnableObjectRetention bool
    Enables object retention on a storage bucket.
    Encryption BucketEncryptionArgs
    The bucket's encryption configuration. Structure is documented below.
    ForceDestroy bool
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    Labels map[string]string
    A map of key/value label pairs to assign to the bucket.
    LifecycleRules []BucketLifecycleRuleArgs
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    Location string
    The GCS location.


    Logging BucketLoggingArgs
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    Name string
    The name of the bucket.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PublicAccessPrevention string
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    RequesterPays bool
    Enables Requester Pays on a storage bucket.
    RetentionPolicy BucketRetentionPolicyArgs
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    Rpo string
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    SelfLink string
    The URI of the created resource.
    SoftDeletePolicy BucketSoftDeletePolicyArgs
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    StorageClass string
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    UniformBucketLevelAccess bool
    Enables Uniform bucket-level access access to a bucket.
    Url string
    The base URL of the bucket, in the format gs://<bucket-name>.
    Versioning BucketVersioningArgs
    The bucket's Versioning configuration. Structure is documented below.
    Website BucketWebsiteArgs
    Configuration if the bucket acts as a website. Structure is documented below.
    autoclass BucketAutoclass
    The bucket's Autoclass configuration. Structure is documented below.
    cors List<BucketCor>
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    customPlacementConfig BucketCustomPlacementConfig
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    defaultEventBasedHold Boolean
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    enableObjectRetention Boolean
    Enables object retention on a storage bucket.
    encryption BucketEncryption
    The bucket's encryption configuration. Structure is documented below.
    forceDestroy Boolean
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels Map<String,String>
    A map of key/value label pairs to assign to the bucket.
    lifecycleRules List<BucketLifecycleRule>
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    location String
    The GCS location.


    logging BucketLogging
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name String
    The name of the bucket.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    publicAccessPrevention String
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    requesterPays Boolean
    Enables Requester Pays on a storage bucket.
    retentionPolicy BucketRetentionPolicy
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo String
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    selfLink String
    The URI of the created resource.
    softDeletePolicy BucketSoftDeletePolicy
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storageClass String
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniformBucketLevelAccess Boolean
    Enables Uniform bucket-level access access to a bucket.
    url String
    The base URL of the bucket, in the format gs://<bucket-name>.
    versioning BucketVersioning
    The bucket's Versioning configuration. Structure is documented below.
    website BucketWebsite
    Configuration if the bucket acts as a website. Structure is documented below.
    autoclass BucketAutoclass
    The bucket's Autoclass configuration. Structure is documented below.
    cors BucketCor[]
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    customPlacementConfig BucketCustomPlacementConfig
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    defaultEventBasedHold boolean
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    enableObjectRetention boolean
    Enables object retention on a storage bucket.
    encryption BucketEncryption
    The bucket's encryption configuration. Structure is documented below.
    forceDestroy boolean
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels {[key: string]: string}
    A map of key/value label pairs to assign to the bucket.
    lifecycleRules BucketLifecycleRule[]
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    location string
    The GCS location.


    logging BucketLogging
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name string
    The name of the bucket.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    publicAccessPrevention string
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    requesterPays boolean
    Enables Requester Pays on a storage bucket.
    retentionPolicy BucketRetentionPolicy
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo string
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    selfLink string
    The URI of the created resource.
    softDeletePolicy BucketSoftDeletePolicy
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storageClass string
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniformBucketLevelAccess boolean
    Enables Uniform bucket-level access access to a bucket.
    url string
    The base URL of the bucket, in the format gs://<bucket-name>.
    versioning BucketVersioning
    The bucket's Versioning configuration. Structure is documented below.
    website BucketWebsite
    Configuration if the bucket acts as a website. Structure is documented below.
    autoclass BucketAutoclassArgs
    The bucket's Autoclass configuration. Structure is documented below.
    cors Sequence[BucketCorArgs]
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    custom_placement_config BucketCustomPlacementConfigArgs
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    default_event_based_hold bool
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    enable_object_retention bool
    Enables object retention on a storage bucket.
    encryption BucketEncryptionArgs
    The bucket's encryption configuration. Structure is documented below.
    force_destroy bool
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels Mapping[str, str]
    A map of key/value label pairs to assign to the bucket.
    lifecycle_rules Sequence[BucketLifecycleRuleArgs]
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    location str
    The GCS location.


    logging BucketLoggingArgs
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name str
    The name of the bucket.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    public_access_prevention str
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    requester_pays bool
    Enables Requester Pays on a storage bucket.
    retention_policy BucketRetentionPolicyArgs
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo str
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    self_link str
    The URI of the created resource.
    soft_delete_policy BucketSoftDeletePolicyArgs
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storage_class str
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniform_bucket_level_access bool
    Enables Uniform bucket-level access access to a bucket.
    url str
    The base URL of the bucket, in the format gs://<bucket-name>.
    versioning BucketVersioningArgs
    The bucket's Versioning configuration. Structure is documented below.
    website BucketWebsiteArgs
    Configuration if the bucket acts as a website. Structure is documented below.
    autoclass Property Map
    The bucket's Autoclass configuration. Structure is documented below.
    cors List<Property Map>
    The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
    customPlacementConfig Property Map
    The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
    defaultEventBasedHold Boolean
    Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
    enableObjectRetention Boolean
    Enables object retention on a storage bucket.
    encryption Property Map
    The bucket's encryption configuration. Structure is documented below.
    forceDestroy Boolean
    When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
    labels Map<String>
    A map of key/value label pairs to assign to the bucket.
    lifecycleRules List<Property Map>
    The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
    location String
    The GCS location.


    logging Property Map
    The bucket's Access & Storage Logs configuration. Structure is documented below.
    name String
    The name of the bucket.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    publicAccessPrevention String
    Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    requesterPays Boolean
    Enables Requester Pays on a storage bucket.
    retentionPolicy Property Map
    Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
    rpo String
    The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets. "DEFAULT" sets default replication. "ASYNC_TURBO" value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to "DEFAULT" for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error.
    selfLink String
    The URI of the created resource.
    softDeletePolicy Property Map
    The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
    storageClass String
    The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    uniformBucketLevelAccess Boolean
    Enables Uniform bucket-level access access to a bucket.
    url String
    The base URL of the bucket, in the format gs://<bucket-name>.
    versioning Property Map
    The bucket's Versioning configuration. Structure is documented below.
    website Property Map
    Configuration if the bucket acts as a website. Structure is documented below.

    Supporting Types

    BucketAutoclass, BucketAutoclassArgs

    Enabled bool
    While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern.
    TerminalStorageClass string
    The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include: NEARLINE, ARCHIVE.
    Enabled bool
    While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern.
    TerminalStorageClass string
    The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include: NEARLINE, ARCHIVE.
    enabled Boolean
    While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern.
    terminalStorageClass String
    The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include: NEARLINE, ARCHIVE.
    enabled boolean
    While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern.
    terminalStorageClass string
    The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include: NEARLINE, ARCHIVE.
    enabled bool
    While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern.
    terminal_storage_class str
    The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include: NEARLINE, ARCHIVE.
    enabled Boolean
    While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern.
    terminalStorageClass String
    The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include: NEARLINE, ARCHIVE.

    BucketCor, BucketCorArgs

    MaxAgeSeconds int
    The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
    Methods List<string>
    The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
    Origins List<string>
    The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
    ResponseHeaders List<string>
    The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
    MaxAgeSeconds int
    The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
    Methods []string
    The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
    Origins []string
    The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
    ResponseHeaders []string
    The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
    maxAgeSeconds Integer
    The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
    methods List<String>
    The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
    origins List<String>
    The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
    responseHeaders List<String>
    The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
    maxAgeSeconds number
    The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
    methods string[]
    The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
    origins string[]
    The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
    responseHeaders string[]
    The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
    max_age_seconds int
    The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
    methods Sequence[str]
    The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
    origins Sequence[str]
    The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
    response_headers Sequence[str]
    The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
    maxAgeSeconds Number
    The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
    methods List<String>
    The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
    origins List<String>
    The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
    responseHeaders List<String>
    The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.

    BucketCustomPlacementConfig, BucketCustomPlacementConfigArgs

    DataLocations List<string>
    The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
    DataLocations []string
    The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
    dataLocations List<String>
    The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
    dataLocations string[]
    The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
    data_locations Sequence[str]
    The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
    dataLocations List<String>
    The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.

    BucketEncryption, BucketEncryptionArgs

    DefaultKmsKeyName string

    The id of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.

    As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the gcp.storage.getProjectServiceAccount data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.

    DefaultKmsKeyName string

    The id of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.

    As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the gcp.storage.getProjectServiceAccount data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.

    defaultKmsKeyName String

    The id of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.

    As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the gcp.storage.getProjectServiceAccount data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.

    defaultKmsKeyName string

    The id of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.

    As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the gcp.storage.getProjectServiceAccount data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.

    default_kms_key_name str

    The id of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.

    As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the gcp.storage.getProjectServiceAccount data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.

    defaultKmsKeyName String

    The id of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.

    As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the gcp.storage.getProjectServiceAccount data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.

    BucketLifecycleRule, BucketLifecycleRuleArgs

    Action BucketLifecycleRuleAction
    The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
    Condition BucketLifecycleRuleCondition
    The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
    Action BucketLifecycleRuleAction
    The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
    Condition BucketLifecycleRuleCondition
    The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
    action BucketLifecycleRuleAction
    The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
    condition BucketLifecycleRuleCondition
    The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
    action BucketLifecycleRuleAction
    The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
    condition BucketLifecycleRuleCondition
    The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
    action BucketLifecycleRuleAction
    The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
    condition BucketLifecycleRuleCondition
    The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
    action Property Map
    The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
    condition Property Map
    The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.

    BucketLifecycleRuleAction, BucketLifecycleRuleActionArgs

    Type string
    The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload.
    StorageClass string
    The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    Type string
    The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload.
    StorageClass string
    The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    type String
    The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload.
    storageClass String
    The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    type string
    The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload.
    storageClass string
    The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    type str
    The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload.
    storage_class str
    The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
    type String
    The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload.
    storageClass String
    The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.

    BucketLifecycleRuleCondition, BucketLifecycleRuleConditionArgs

    Age int
    Minimum age of an object in days to satisfy this condition.
    CreatedBefore string
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
    CustomTimeBefore string
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
    DaysSinceCustomTime int
    Days since the date set in the customTime metadata for the object. This condition is satisfied when the current date and time is at least the specified number of days after the customTime.
    DaysSinceNoncurrentTime int
    Relevant only for versioned objects. Number of days elapsed since the noncurrent timestamp of an object.
    MatchesPrefixes List<string>
    One or more matching name prefixes to satisfy this condition.
    MatchesStorageClasses List<string>
    Storage Class of objects to satisfy this condition. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, DURABLE_REDUCED_AVAILABILITY.
    MatchesSuffixes List<string>
    One or more matching name suffixes to satisfy this condition.
    NoAge bool
    While set true, age value will be omitted. Note Required to set true when age is unset in the config file.
    NoncurrentTimeBefore string
    Relevant only for versioned objects. The date in RFC 3339 (e.g. 2017-06-13) when the object became nonconcurrent.
    NumNewerVersions int
    Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
    WithState string
    Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY".
    Age int
    Minimum age of an object in days to satisfy this condition.
    CreatedBefore string
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
    CustomTimeBefore string
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
    DaysSinceCustomTime int
    Days since the date set in the customTime metadata for the object. This condition is satisfied when the current date and time is at least the specified number of days after the customTime.
    DaysSinceNoncurrentTime int
    Relevant only for versioned objects. Number of days elapsed since the noncurrent timestamp of an object.
    MatchesPrefixes []string
    One or more matching name prefixes to satisfy this condition.
    MatchesStorageClasses []string
    Storage Class of objects to satisfy this condition. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, DURABLE_REDUCED_AVAILABILITY.
    MatchesSuffixes []string
    One or more matching name suffixes to satisfy this condition.
    NoAge bool
    While set true, age value will be omitted. Note Required to set true when age is unset in the config file.
    NoncurrentTimeBefore string
    Relevant only for versioned objects. The date in RFC 3339 (e.g. 2017-06-13) when the object became nonconcurrent.
    NumNewerVersions int
    Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
    WithState string
    Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY".
    age Integer
    Minimum age of an object in days to satisfy this condition.
    createdBefore String
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
    customTimeBefore String
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
    daysSinceCustomTime Integer
    Days since the date set in the customTime metadata for the object. This condition is satisfied when the current date and time is at least the specified number of days after the customTime.
    daysSinceNoncurrentTime Integer
    Relevant only for versioned objects. Number of days elapsed since the noncurrent timestamp of an object.
    matchesPrefixes List<String>
    One or more matching name prefixes to satisfy this condition.
    matchesStorageClasses List<String>
    Storage Class of objects to satisfy this condition. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, DURABLE_REDUCED_AVAILABILITY.
    matchesSuffixes List<String>
    One or more matching name suffixes to satisfy this condition.
    noAge Boolean
    While set true, age value will be omitted. Note Required to set true when age is unset in the config file.
    noncurrentTimeBefore String
    Relevant only for versioned objects. The date in RFC 3339 (e.g. 2017-06-13) when the object became nonconcurrent.
    numNewerVersions Integer
    Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
    withState String
    Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY".
    age number
    Minimum age of an object in days to satisfy this condition.
    createdBefore string
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
    customTimeBefore string
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
    daysSinceCustomTime number
    Days since the date set in the customTime metadata for the object. This condition is satisfied when the current date and time is at least the specified number of days after the customTime.
    daysSinceNoncurrentTime number
    Relevant only for versioned objects. Number of days elapsed since the noncurrent timestamp of an object.
    matchesPrefixes string[]
    One or more matching name prefixes to satisfy this condition.
    matchesStorageClasses string[]
    Storage Class of objects to satisfy this condition. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, DURABLE_REDUCED_AVAILABILITY.
    matchesSuffixes string[]
    One or more matching name suffixes to satisfy this condition.
    noAge boolean
    While set true, age value will be omitted. Note Required to set true when age is unset in the config file.
    noncurrentTimeBefore string
    Relevant only for versioned objects. The date in RFC 3339 (e.g. 2017-06-13) when the object became nonconcurrent.
    numNewerVersions number
    Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
    withState string
    Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY".
    age int
    Minimum age of an object in days to satisfy this condition.
    created_before str
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
    custom_time_before str
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
    days_since_custom_time int
    Days since the date set in the customTime metadata for the object. This condition is satisfied when the current date and time is at least the specified number of days after the customTime.
    days_since_noncurrent_time int
    Relevant only for versioned objects. Number of days elapsed since the noncurrent timestamp of an object.
    matches_prefixes Sequence[str]
    One or more matching name prefixes to satisfy this condition.
    matches_storage_classes Sequence[str]
    Storage Class of objects to satisfy this condition. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, DURABLE_REDUCED_AVAILABILITY.
    matches_suffixes Sequence[str]
    One or more matching name suffixes to satisfy this condition.
    no_age bool
    While set true, age value will be omitted. Note Required to set true when age is unset in the config file.
    noncurrent_time_before str
    Relevant only for versioned objects. The date in RFC 3339 (e.g. 2017-06-13) when the object became nonconcurrent.
    num_newer_versions int
    Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
    with_state str
    Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY".
    age Number
    Minimum age of an object in days to satisfy this condition.
    createdBefore String
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
    customTimeBefore String
    A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
    daysSinceCustomTime Number
    Days since the date set in the customTime metadata for the object. This condition is satisfied when the current date and time is at least the specified number of days after the customTime.
    daysSinceNoncurrentTime Number
    Relevant only for versioned objects. Number of days elapsed since the noncurrent timestamp of an object.
    matchesPrefixes List<String>
    One or more matching name prefixes to satisfy this condition.
    matchesStorageClasses List<String>
    Storage Class of objects to satisfy this condition. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, DURABLE_REDUCED_AVAILABILITY.
    matchesSuffixes List<String>
    One or more matching name suffixes to satisfy this condition.
    noAge Boolean
    While set true, age value will be omitted. Note Required to set true when age is unset in the config file.
    noncurrentTimeBefore String
    Relevant only for versioned objects. The date in RFC 3339 (e.g. 2017-06-13) when the object became nonconcurrent.
    numNewerVersions Number
    Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
    withState String
    Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY".

    BucketLogging, BucketLoggingArgs

    LogBucket string
    The bucket that will receive log objects.
    LogObjectPrefix string
    The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
    LogBucket string
    The bucket that will receive log objects.
    LogObjectPrefix string
    The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
    logBucket String
    The bucket that will receive log objects.
    logObjectPrefix String
    The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
    logBucket string
    The bucket that will receive log objects.
    logObjectPrefix string
    The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
    log_bucket str
    The bucket that will receive log objects.
    log_object_prefix str
    The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
    logBucket String
    The bucket that will receive log objects.
    logObjectPrefix String
    The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.

    BucketRetentionPolicy, BucketRetentionPolicyArgs

    RetentionPeriod int
    The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
    IsLocked bool
    If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
    RetentionPeriod int
    The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
    IsLocked bool
    If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
    retentionPeriod Integer
    The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
    isLocked Boolean
    If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
    retentionPeriod number
    The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
    isLocked boolean
    If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
    retention_period int
    The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
    is_locked bool
    If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
    retentionPeriod Number
    The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
    isLocked Boolean
    If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.

    BucketSoftDeletePolicy, BucketSoftDeletePolicyArgs

    EffectiveTime string
    Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
    RetentionDurationSeconds int
    The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
    EffectiveTime string
    Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
    RetentionDurationSeconds int
    The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
    effectiveTime String
    Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
    retentionDurationSeconds Integer
    The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
    effectiveTime string
    Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
    retentionDurationSeconds number
    The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
    effective_time str
    Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
    retention_duration_seconds int
    The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
    effectiveTime String
    Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
    retentionDurationSeconds Number
    The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.

    BucketVersioning, BucketVersioningArgs

    Enabled bool
    While set to true, versioning is fully enabled for this bucket.
    Enabled bool
    While set to true, versioning is fully enabled for this bucket.
    enabled Boolean
    While set to true, versioning is fully enabled for this bucket.
    enabled boolean
    While set to true, versioning is fully enabled for this bucket.
    enabled bool
    While set to true, versioning is fully enabled for this bucket.
    enabled Boolean
    While set to true, versioning is fully enabled for this bucket.

    BucketWebsite, BucketWebsiteArgs

    MainPageSuffix string
    Behaves as the bucket's directory index where missing objects are treated as potential directories.
    NotFoundPage string
    The custom object to return when a requested resource is not found.
    MainPageSuffix string
    Behaves as the bucket's directory index where missing objects are treated as potential directories.
    NotFoundPage string
    The custom object to return when a requested resource is not found.
    mainPageSuffix String
    Behaves as the bucket's directory index where missing objects are treated as potential directories.
    notFoundPage String
    The custom object to return when a requested resource is not found.
    mainPageSuffix string
    Behaves as the bucket's directory index where missing objects are treated as potential directories.
    notFoundPage string
    The custom object to return when a requested resource is not found.
    main_page_suffix str
    Behaves as the bucket's directory index where missing objects are treated as potential directories.
    not_found_page str
    The custom object to return when a requested resource is not found.
    mainPageSuffix String
    Behaves as the bucket's directory index where missing objects are treated as potential directories.
    notFoundPage String
    The custom object to return when a requested resource is not found.

    Import

    Storage buckets can be imported using the name or project/name. If the project is not

    passed to the import command it will be inferred from the provider block or environment variables.

    If it cannot be inferred it will be queried from the Compute API (this will fail if the API is

    not enabled).

    • {{project_id}}/{{bucket}}

    • {{bucket}}

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

    $ pulumi import gcp:storage/bucket:Bucket default {{bucket}}
    
    $ pulumi import gcp:storage/bucket:Bucket default {{project_id}}/{{bucket}}
    

    false in state. If you’ve set it to true in config, run pulumi up to

    update the value set in state. If you delete this resource before updating the

    value, objects in the bucket will not be destroyed.

    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
    Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 2024 by Pulumi