Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.storage.kotlin.BucketArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.storage.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.storage.BucketArgs.builder
import com.pulumi.gcp.storage.kotlin.inputs.BucketAutoclassArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketAutoclassArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketCorArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketCorArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketCustomPlacementConfigArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketCustomPlacementConfigArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketEncryptionArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketEncryptionArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketLifecycleRuleArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketLifecycleRuleArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketLoggingArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketLoggingArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketRetentionPolicyArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketRetentionPolicyArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketSoftDeletePolicyArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketSoftDeletePolicyArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketVersioningArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketVersioningArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketWebsiteArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketWebsiteArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* 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](https://cloud.google.com/storage/docs/overview)
* and
* [API](https://cloud.google.com/storage/docs/json_api/v1/buckets).
* **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
*
* ```typescript
* 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,
* }],
* });
* ```
* ```python
* 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={
* "main_page_suffix": "index.html",
* "not_found_page": "404.html",
* },
* cors=[{
* "origins": ["http://image-store.com"],
* "methods": [
* "GET",
* "HEAD",
* "PUT",
* "POST",
* "DELETE",
* ],
* "response_headers": ["*"],
* "max_age_seconds": 3600,
* }])
* ```
* ```csharp
* 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,
* },
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
*
* ```typescript
* 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",
* },
* },
* ],
* });
* ```
* ```python
* 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=[
* {
* "condition": {
* "age": 3,
* },
* "action": {
* "type": "Delete",
* },
* },
* {
* "condition": {
* "age": 1,
* },
* "action": {
* "type": "AbortIncompleteMultipartUpload",
* },
* },
* ])
* ```
* ```csharp
* 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",
* },
* },
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ### Life Cycle Settings For Storage Bucket Objects With `No_age` Enabled
* When creating a life cycle condition that does not also include an `age` field, a default `age` of 0 will be set. Set the `no_age` flag to `true` to prevent this and avoid any potentially unintended interactions.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const no_age_enabled = new gcp.storage.Bucket("no-age-enabled", {
* name: "no-age-enabled-bucket",
* location: "US",
* forceDestroy: true,
* lifecycleRules: [{
* action: {
* type: "Delete",
* },
* condition: {
* daysSinceNoncurrentTime: 3,
* noAge: true,
* },
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* no_age_enabled = gcp.storage.Bucket("no-age-enabled",
* name="no-age-enabled-bucket",
* location="US",
* force_destroy=True,
* lifecycle_rules=[{
* "action": {
* "type": "Delete",
* },
* "condition": {
* "days_since_noncurrent_time": 3,
* "no_age": True,
* },
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var no_age_enabled = new Gcp.Storage.Bucket("no-age-enabled", new()
* {
* Name = "no-age-enabled-bucket",
* Location = "US",
* ForceDestroy = true,
* LifecycleRules = new[]
* {
* new Gcp.Storage.Inputs.BucketLifecycleRuleArgs
* {
* Action = new Gcp.Storage.Inputs.BucketLifecycleRuleActionArgs
* {
* Type = "Delete",
* },
* Condition = new Gcp.Storage.Inputs.BucketLifecycleRuleConditionArgs
* {
* DaysSinceNoncurrentTime = 3,
* NoAge = true,
* },
* },
* },
* });
* });
* ```
* ```go
* 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, "no-age-enabled", &storage.BucketArgs{
* Name: pulumi.String("no-age-enabled-bucket"),
* Location: pulumi.String("US"),
* ForceDestroy: pulumi.Bool(true),
* LifecycleRules: storage.BucketLifecycleRuleArray{
* &storage.BucketLifecycleRuleArgs{
* Action: &storage.BucketLifecycleRuleActionArgs{
* Type: pulumi.String("Delete"),
* },
* Condition: &storage.BucketLifecycleRuleConditionArgs{
* DaysSinceNoncurrentTime: pulumi.Int(3),
* NoAge: pulumi.Bool(true),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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.BucketLifecycleRuleActionArgs;
* import com.pulumi.gcp.storage.inputs.BucketLifecycleRuleConditionArgs;
* 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 no_age_enabled = new Bucket("no-age-enabled", BucketArgs.builder()
* .name("no-age-enabled-bucket")
* .location("US")
* .forceDestroy(true)
* .lifecycleRules(BucketLifecycleRuleArgs.builder()
* .action(BucketLifecycleRuleActionArgs.builder()
* .type("Delete")
* .build())
* .condition(BucketLifecycleRuleConditionArgs.builder()
* .daysSinceNoncurrentTime(3)
* .noAge(true)
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* no-age-enabled:
* type: gcp:storage:Bucket
* properties:
* name: no-age-enabled-bucket
* location: US
* forceDestroy: true
* lifecycleRules:
* - action:
* type: Delete
* condition:
* daysSinceNoncurrentTime: 3
* noAge: true
* ```
*
* ### Enabling Public Access Prevention
*
* ```typescript
* 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",
* });
* ```
* ```python
* 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")
* ```
* ```csharp
* 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",
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* resources:
* auto-expire:
* type: gcp:storage:Bucket
* properties:
* name: no-public-access-bucket
* location: US
* forceDestroy: true
* publicAccessPrevention: enforced
* ```
*
* ## 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:
* ```sh
* $ pulumi import gcp:storage/bucket:Bucket default {{bucket}}
* ```
* ```sh
* $ 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.
* @property autoclass The bucket's [Autoclass](https://cloud.google.com/storage/docs/autoclass) configuration. Structure is documented below.
* @property cors The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
* @property customPlacementConfig 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.
* @property defaultEventBasedHold Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
* @property enableObjectRetention Enables [object retention](https://cloud.google.com/storage/docs/object-lock) on a storage bucket.
* @property encryption The bucket's encryption configuration. Structure is documented below.
* @property forceDestroy 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.
* @property labels A map of key/value label pairs to assign to the bucket.
* @property lifecycleRules The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
* @property location The [GCS location](https://cloud.google.com/storage/docs/bucket-locations).
* - - -
* @property logging The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration. Structure is documented below.
* @property name The name of the bucket.
* @property project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @property publicAccessPrevention Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses [public access prevention](https://cloud.google.com/storage/docs/public-access-prevention). only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
* @property requesterPays Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
* @property retentionPolicy Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
* @property rpo 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](https://cloud.google.com/storage/docs/managing-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.
* @property softDeletePolicy 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
* @property storageClass The [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of the new bucket. Supported values include: `STANDARD`, `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
* @property uniformBucketLevelAccess Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
* @property versioning The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration. Structure is documented below.
* @property website Configuration if the bucket acts as a website. Structure is documented below.
*/
public data class BucketArgs(
public val autoclass: Output? = null,
public val cors: Output>? = null,
public val customPlacementConfig: Output? = null,
public val defaultEventBasedHold: Output? = null,
public val enableObjectRetention: Output? = null,
public val encryption: Output? = null,
public val forceDestroy: Output? = null,
public val labels: Output>? = null,
public val lifecycleRules: Output>? = null,
public val location: Output? = null,
public val logging: Output? = null,
public val name: Output? = null,
public val project: Output? = null,
public val publicAccessPrevention: Output? = null,
public val requesterPays: Output? = null,
public val retentionPolicy: Output? = null,
public val rpo: Output? = null,
public val softDeletePolicy: Output? = null,
public val storageClass: Output? = null,
public val uniformBucketLevelAccess: Output? = null,
public val versioning: Output? = null,
public val website: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.storage.BucketArgs =
com.pulumi.gcp.storage.BucketArgs.builder()
.autoclass(autoclass?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.cors(cors?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
.customPlacementConfig(
customPlacementConfig?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.defaultEventBasedHold(defaultEventBasedHold?.applyValue({ args0 -> args0 }))
.enableObjectRetention(enableObjectRetention?.applyValue({ args0 -> args0 }))
.encryption(encryption?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.forceDestroy(forceDestroy?.applyValue({ args0 -> args0 }))
.labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.lifecycleRules(
lifecycleRules?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.location(location?.applyValue({ args0 -> args0 }))
.logging(logging?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.name(name?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.publicAccessPrevention(publicAccessPrevention?.applyValue({ args0 -> args0 }))
.requesterPays(requesterPays?.applyValue({ args0 -> args0 }))
.retentionPolicy(retentionPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.rpo(rpo?.applyValue({ args0 -> args0 }))
.softDeletePolicy(softDeletePolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.storageClass(storageClass?.applyValue({ args0 -> args0 }))
.uniformBucketLevelAccess(uniformBucketLevelAccess?.applyValue({ args0 -> args0 }))
.versioning(versioning?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.website(website?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}
/**
* Builder for [BucketArgs].
*/
@PulumiTagMarker
public class BucketArgsBuilder internal constructor() {
private var autoclass: Output? = null
private var cors: Output>? = null
private var customPlacementConfig: Output? = null
private var defaultEventBasedHold: Output? = null
private var enableObjectRetention: Output? = null
private var encryption: Output? = null
private var forceDestroy: Output? = null
private var labels: Output>? = null
private var lifecycleRules: Output>? = null
private var location: Output? = null
private var logging: Output? = null
private var name: Output? = null
private var project: Output? = null
private var publicAccessPrevention: Output? = null
private var requesterPays: Output? = null
private var retentionPolicy: Output? = null
private var rpo: Output? = null
private var softDeletePolicy: Output? = null
private var storageClass: Output? = null
private var uniformBucketLevelAccess: Output? = null
private var versioning: Output? = null
private var website: Output? = null
/**
* @param value The bucket's [Autoclass](https://cloud.google.com/storage/docs/autoclass) configuration. Structure is documented below.
*/
@JvmName("twaysfqrkkdpuljv")
public suspend fun autoclass(`value`: Output) {
this.autoclass = value
}
/**
* @param value The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("obcngsftxrcmynay")
public suspend fun cors(`value`: Output>) {
this.cors = value
}
@JvmName("rqfcaorukmgkmtdt")
public suspend fun cors(vararg values: Output) {
this.cors = Output.all(values.asList())
}
/**
* @param values The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("rtbbagopndicglhi")
public suspend fun cors(values: List>) {
this.cors = Output.all(values)
}
/**
* @param value 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.
*/
@JvmName("ikorveynamrpriyf")
public suspend fun customPlacementConfig(`value`: Output) {
this.customPlacementConfig = value
}
/**
* @param value Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
*/
@JvmName("ucxanbmmimiqujhh")
public suspend fun defaultEventBasedHold(`value`: Output) {
this.defaultEventBasedHold = value
}
/**
* @param value Enables [object retention](https://cloud.google.com/storage/docs/object-lock) on a storage bucket.
*/
@JvmName("rambdpgbumljicvs")
public suspend fun enableObjectRetention(`value`: Output) {
this.enableObjectRetention = value
}
/**
* @param value The bucket's encryption configuration. Structure is documented below.
*/
@JvmName("ahxbmvjtbtykpxme")
public suspend fun encryption(`value`: Output) {
this.encryption = value
}
/**
* @param value 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.
*/
@JvmName("wuglqbxxahnyqkvg")
public suspend fun forceDestroy(`value`: Output) {
this.forceDestroy = value
}
/**
* @param value A map of key/value label pairs to assign to the bucket.
*/
@JvmName("dfasnbdbvodsyoqy")
public suspend fun labels(`value`: Output>) {
this.labels = value
}
/**
* @param value The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("ddmkvujdbywxqqyt")
public suspend fun lifecycleRules(`value`: Output>) {
this.lifecycleRules = value
}
@JvmName("rlomtnedvcnlavyw")
public suspend fun lifecycleRules(vararg values: Output) {
this.lifecycleRules = Output.all(values.asList())
}
/**
* @param values The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("pcckkogpniodvpxg")
public suspend fun lifecycleRules(values: List>) {
this.lifecycleRules = Output.all(values)
}
/**
* @param value The [GCS location](https://cloud.google.com/storage/docs/bucket-locations).
* - - -
*/
@JvmName("ogsvqpiwekaxeomm")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration. Structure is documented below.
*/
@JvmName("rgfjltwxpkcmqhgt")
public suspend fun logging(`value`: Output) {
this.logging = value
}
/**
* @param value The name of the bucket.
*/
@JvmName("ufxqwxbrtaeihkbd")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
@JvmName("rxrcotsldupsjwxj")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses [public access prevention](https://cloud.google.com/storage/docs/public-access-prevention). only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
*/
@JvmName("riidlmckbgitkika")
public suspend fun publicAccessPrevention(`value`: Output) {
this.publicAccessPrevention = value
}
/**
* @param value Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
*/
@JvmName("uvmladsbvwjbrxor")
public suspend fun requesterPays(`value`: Output) {
this.requesterPays = value
}
/**
* @param value Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
*/
@JvmName("iuhgvyrohdabretw")
public suspend fun retentionPolicy(`value`: Output) {
this.retentionPolicy = value
}
/**
* @param value 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](https://cloud.google.com/storage/docs/managing-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.
*/
@JvmName("bxbamfrvqsexjvkx")
public suspend fun rpo(`value`: Output) {
this.rpo = value
}
/**
* @param value 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
*/
@JvmName("whpssvvtvrmiihxa")
public suspend fun softDeletePolicy(`value`: Output) {
this.softDeletePolicy = value
}
/**
* @param value The [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of the new bucket. Supported values include: `STANDARD`, `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
*/
@JvmName("ltiuegyughqrebxi")
public suspend fun storageClass(`value`: Output) {
this.storageClass = value
}
/**
* @param value Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
*/
@JvmName("mqjbiancjkvbpgmr")
public suspend fun uniformBucketLevelAccess(`value`: Output) {
this.uniformBucketLevelAccess = value
}
/**
* @param value The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration. Structure is documented below.
*/
@JvmName("aavibsceubefwanj")
public suspend fun versioning(`value`: Output) {
this.versioning = value
}
/**
* @param value Configuration if the bucket acts as a website. Structure is documented below.
*/
@JvmName("qpwbyhihwlmrulpp")
public suspend fun website(`value`: Output) {
this.website = value
}
/**
* @param value The bucket's [Autoclass](https://cloud.google.com/storage/docs/autoclass) configuration. Structure is documented below.
*/
@JvmName("ojthyqjjawsbjxje")
public suspend fun autoclass(`value`: BucketAutoclassArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.autoclass = mapped
}
/**
* @param argument The bucket's [Autoclass](https://cloud.google.com/storage/docs/autoclass) configuration. Structure is documented below.
*/
@JvmName("tkmuxgihvcgrufvv")
public suspend fun autoclass(argument: suspend BucketAutoclassArgsBuilder.() -> Unit) {
val toBeMapped = BucketAutoclassArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.autoclass = mapped
}
/**
* @param value The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("lklxyerowwafnenv")
public suspend fun cors(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cors = mapped
}
/**
* @param argument The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("tbfkrsvgirxbjldh")
public suspend fun cors(argument: List Unit>) {
val toBeMapped = argument.toList().map { BucketCorArgsBuilder().applySuspend { it() }.build() }
val mapped = of(toBeMapped)
this.cors = mapped
}
/**
* @param argument The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("fbmegmwvfdrebtml")
public suspend fun cors(vararg argument: suspend BucketCorArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map { BucketCorArgsBuilder().applySuspend { it() }.build() }
val mapped = of(toBeMapped)
this.cors = mapped
}
/**
* @param argument The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("wvqvdbwuqofwnofb")
public suspend fun cors(argument: suspend BucketCorArgsBuilder.() -> Unit) {
val toBeMapped = listOf(BucketCorArgsBuilder().applySuspend { argument() }.build())
val mapped = of(toBeMapped)
this.cors = mapped
}
/**
* @param values The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("scrppajregjsmdrq")
public suspend fun cors(vararg values: BucketCorArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.cors = mapped
}
/**
* @param value 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.
*/
@JvmName("plnhjndviidpfnuj")
public suspend fun customPlacementConfig(`value`: BucketCustomPlacementConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.customPlacementConfig = mapped
}
/**
* @param argument 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.
*/
@JvmName("tjgapvhuitwwiwng")
public suspend fun customPlacementConfig(argument: suspend BucketCustomPlacementConfigArgsBuilder.() -> Unit) {
val toBeMapped = BucketCustomPlacementConfigArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.customPlacementConfig = mapped
}
/**
* @param value Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
*/
@JvmName("qiajqbddmortrjof")
public suspend fun defaultEventBasedHold(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.defaultEventBasedHold = mapped
}
/**
* @param value Enables [object retention](https://cloud.google.com/storage/docs/object-lock) on a storage bucket.
*/
@JvmName("saaobeeispiemvna")
public suspend fun enableObjectRetention(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.enableObjectRetention = mapped
}
/**
* @param value The bucket's encryption configuration. Structure is documented below.
*/
@JvmName("fuitdaiitqauqyse")
public suspend fun encryption(`value`: BucketEncryptionArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.encryption = mapped
}
/**
* @param argument The bucket's encryption configuration. Structure is documented below.
*/
@JvmName("qpwavatvvejnwnmd")
public suspend fun encryption(argument: suspend BucketEncryptionArgsBuilder.() -> Unit) {
val toBeMapped = BucketEncryptionArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.encryption = mapped
}
/**
* @param value 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.
*/
@JvmName("ynuerwcpjgxgjofo")
public suspend fun forceDestroy(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.forceDestroy = mapped
}
/**
* @param value A map of key/value label pairs to assign to the bucket.
*/
@JvmName("aiqbdhvejcxaowkv")
public suspend fun labels(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param values A map of key/value label pairs to assign to the bucket.
*/
@JvmName("sbipjijxpuvciqta")
public fun labels(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param value The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("wxwhblkpxsbpkdcc")
public suspend fun lifecycleRules(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.lifecycleRules = mapped
}
/**
* @param argument The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("kfmhlrjpmmrtvuqw")
public suspend fun lifecycleRules(argument: List Unit>) {
val toBeMapped = argument.toList().map {
BucketLifecycleRuleArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.lifecycleRules = mapped
}
/**
* @param argument The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("vlkafraqmqombtub")
public suspend fun lifecycleRules(vararg argument: suspend BucketLifecycleRuleArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
BucketLifecycleRuleArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.lifecycleRules = mapped
}
/**
* @param argument The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("dpehgkpmdyuuuxxe")
public suspend fun lifecycleRules(argument: suspend BucketLifecycleRuleArgsBuilder.() -> Unit) {
val toBeMapped = listOf(BucketLifecycleRuleArgsBuilder().applySuspend { argument() }.build())
val mapped = of(toBeMapped)
this.lifecycleRules = mapped
}
/**
* @param values The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
*/
@JvmName("ltbgtxiisvmqqbcs")
public suspend fun lifecycleRules(vararg values: BucketLifecycleRuleArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.lifecycleRules = mapped
}
/**
* @param value The [GCS location](https://cloud.google.com/storage/docs/bucket-locations).
* - - -
*/
@JvmName("ancuwdwbqqaydgkx")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration. Structure is documented below.
*/
@JvmName("cnmcjabhyemhcnxb")
public suspend fun logging(`value`: BucketLoggingArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.logging = mapped
}
/**
* @param argument The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration. Structure is documented below.
*/
@JvmName("dmfvrwxxrtyyadvb")
public suspend fun logging(argument: suspend BucketLoggingArgsBuilder.() -> Unit) {
val toBeMapped = BucketLoggingArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.logging = mapped
}
/**
* @param value The name of the bucket.
*/
@JvmName("vidwjxbjmbmfwqeb")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
@JvmName("ftlcraasuckhcsby")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses [public access prevention](https://cloud.google.com/storage/docs/public-access-prevention). only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
*/
@JvmName("fhhexcmaetmlgdvk")
public suspend fun publicAccessPrevention(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.publicAccessPrevention = mapped
}
/**
* @param value Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
*/
@JvmName("arhjogqfemghyysn")
public suspend fun requesterPays(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requesterPays = mapped
}
/**
* @param value Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
*/
@JvmName("aahxuovmcvtchess")
public suspend fun retentionPolicy(`value`: BucketRetentionPolicyArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.retentionPolicy = mapped
}
/**
* @param argument Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
*/
@JvmName("wihrtbfrraehmkmj")
public suspend fun retentionPolicy(argument: suspend BucketRetentionPolicyArgsBuilder.() -> Unit) {
val toBeMapped = BucketRetentionPolicyArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.retentionPolicy = mapped
}
/**
* @param value 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](https://cloud.google.com/storage/docs/managing-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.
*/
@JvmName("pvropxiharmdqfgt")
public suspend fun rpo(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.rpo = mapped
}
/**
* @param value 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
*/
@JvmName("lmqjinymowwsesmv")
public suspend fun softDeletePolicy(`value`: BucketSoftDeletePolicyArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.softDeletePolicy = mapped
}
/**
* @param argument 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
*/
@JvmName("bjmtyocxkhocehkg")
public suspend fun softDeletePolicy(argument: suspend BucketSoftDeletePolicyArgsBuilder.() -> Unit) {
val toBeMapped = BucketSoftDeletePolicyArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.softDeletePolicy = mapped
}
/**
* @param value The [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of the new bucket. Supported values include: `STANDARD`, `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
*/
@JvmName("xoamnnqmtoconiyk")
public suspend fun storageClass(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.storageClass = mapped
}
/**
* @param value Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
*/
@JvmName("oolqoqjnvkkgdhhl")
public suspend fun uniformBucketLevelAccess(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.uniformBucketLevelAccess = mapped
}
/**
* @param value The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration. Structure is documented below.
*/
@JvmName("ycyfdegeoqlvebrn")
public suspend fun versioning(`value`: BucketVersioningArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.versioning = mapped
}
/**
* @param argument The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration. Structure is documented below.
*/
@JvmName("ejjxgvdsjrfryfjk")
public suspend fun versioning(argument: suspend BucketVersioningArgsBuilder.() -> Unit) {
val toBeMapped = BucketVersioningArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.versioning = mapped
}
/**
* @param value Configuration if the bucket acts as a website. Structure is documented below.
*/
@JvmName("vrmsrlxisbqlfufs")
public suspend fun website(`value`: BucketWebsiteArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.website = mapped
}
/**
* @param argument Configuration if the bucket acts as a website. Structure is documented below.
*/
@JvmName("imrsgnoqppyykcrb")
public suspend fun website(argument: suspend BucketWebsiteArgsBuilder.() -> Unit) {
val toBeMapped = BucketWebsiteArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.website = mapped
}
internal fun build(): BucketArgs = BucketArgs(
autoclass = autoclass,
cors = cors,
customPlacementConfig = customPlacementConfig,
defaultEventBasedHold = defaultEventBasedHold,
enableObjectRetention = enableObjectRetention,
encryption = encryption,
forceDestroy = forceDestroy,
labels = labels,
lifecycleRules = lifecycleRules,
location = location,
logging = logging,
name = name,
project = project,
publicAccessPrevention = publicAccessPrevention,
requesterPays = requesterPays,
retentionPolicy = retentionPolicy,
rpo = rpo,
softDeletePolicy = softDeletePolicy,
storageClass = storageClass,
uniformBucketLevelAccess = uniformBucketLevelAccess,
versioning = versioning,
website = website,
)
}