Bucket class

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,
        },
        {
            origins: ["http://image-store.com"],
            methods: [
                "GET",
                "HEAD",
                "PUT",
                "POST",
                "DELETE",
            ],
            responseHeaders: ["*"],
            maxAgeSeconds: 0,
        },
    ],
});
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,
        },
        {
            "origins": ["http://image-store.com"],
            "methods": [
                "GET",
                "HEAD",
                "PUT",
                "POST",
                "DELETE",
            ],
            "response_headers": ["*"],
            "max_age_seconds": 0,
        },
    ])
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,
            },
            new Gcp.Storage.Inputs.BucketCorArgs
            {
                Origins = new[]
                {
                    "http://image-store.com",
                },
                Methods = new[]
                {
                    "GET",
                    "HEAD",
                    "PUT",
                    "POST",
                    "DELETE",
                },
                ResponseHeaders = new[]
                {
                    "*",
                },
                MaxAgeSeconds = 0,
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/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),
				},
				&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(0),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "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
  }
  cors {
    origins          = ["http://image-store.com"]
    methods          = ["GET", "HEAD", "PUT", "POST", "DELETE"]
    response_headers = ["*"]
    max_age_seconds  = 0
  }
}
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.ArrayList;
import java.util.Arrays;
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(),
                BucketCorArgs.builder()
                    .origins("http://image-store.com")
                    .methods(
                        "GET",
                        "HEAD",
                        "PUT",
                        "POST",
                        "DELETE")
                    .responseHeaders("*")
                    .maxAgeSeconds(0)
                    .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
        - origins:
            - http://image-store.com
          methods:
            - GET
            - HEAD
            - PUT
            - POST
            - DELETE
          responseHeaders:
            - '*'
          maxAgeSeconds: 0

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=[
        {
            "condition": {
                "age": 3,
            },
            "action": {
                "type": "Delete",
            },
        },
        {
            "condition": {
                "age": 1,
            },
            "action": {
                "type": "AbortIncompleteMultipartUpload",
            },
        },
    ])
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 main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/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
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_storage_bucket" "auto-expire" {
  name          = "auto-expiring-bucket"
  location      = "US"
  force_destroy = true
  lifecycle_rules {
    condition = {
      age = 3
    }
    action = {
      type = "Delete"
    }
  }
  lifecycle_rules {
    condition = {
      age = 1
    }
    action = {
      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.ArrayList;
import java.util.Arrays;
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

Life Cycle Settings For Storage Bucket Objects With Send_age_if_zero Disabled

When creating a life cycle condition that does not also include an age field, a default age of 0 will be set. Set the sendAgeIfZero flag to false to prevent this and avoid any potentially unintended interactions.

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,
            sendAgeIfZero: false,
        },
    }],
});
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,
            "send_age_if_zero": False,
        },
    }])
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,
                    SendAgeIfZero = false,
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/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),
						SendAgeIfZero:           pulumi.Bool(false),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "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
      send_age_if_zero           = false
    }
  }
}
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.ArrayList;
import java.util.Arrays;
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)
                    .sendAgeIfZero(false)
                    .build())
                .build())
            .build());

    }
}
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
            sendAgeIfZero: false

Enabling Public Access Prevention

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const no_public_access = new gcp.storage.Bucket("no-public-access", {
    name: "no-public-access-bucket",
    location: "US",
    forceDestroy: true,
    publicAccessPrevention: "enforced",
});
import pulumi
import pulumi_gcp as gcp

no_public_access = gcp.storage.Bucket("no-public-access",
    name="no-public-access-bucket",
    location="US",
    force_destroy=True,
    public_access_prevention="enforced")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var no_public_access = new Gcp.Storage.Bucket("no-public-access", new()
    {
        Name = "no-public-access-bucket",
        Location = "US",
        ForceDestroy = true,
        PublicAccessPrevention = "enforced",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/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-public-access", &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
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_storage_bucket" "no-public-access" {
  name                     = "no-public-access-bucket"
  location                 = "US"
  force_destroy            = true
  public_access_prevention = "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.ArrayList;
import java.util.Arrays;
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_public_access = new Bucket("no-public-access", BucketArgs.builder()
            .name("no-public-access-bucket")
            .location("US")
            .forceDestroy(true)
            .publicAccessPrevention("enforced")
            .build());

    }
}
resources:
  no-public-access:
    type: gcp:storage:Bucket
    properties:
      name: no-public-access-bucket
      location: US
      forceDestroy: true
      publicAccessPrevention: enforced

Enabling Hierarchical Namespace

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const hns_enabled = new gcp.storage.Bucket("hns-enabled", {
    name: "hns-enabled-bucket",
    location: "US",
    forceDestroy: true,
    hierarchicalNamespace: {
        enabled: true,
    },
});
import pulumi
import pulumi_gcp as gcp

hns_enabled = gcp.storage.Bucket("hns-enabled",
    name="hns-enabled-bucket",
    location="US",
    force_destroy=True,
    hierarchical_namespace={
        "enabled": True,
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var hns_enabled = new Gcp.Storage.Bucket("hns-enabled", new()
    {
        Name = "hns-enabled-bucket",
        Location = "US",
        ForceDestroy = true,
        HierarchicalNamespace = new Gcp.Storage.Inputs.BucketHierarchicalNamespaceArgs
        {
            Enabled = true,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := storage.NewBucket(ctx, "hns-enabled", &storage.BucketArgs{
			Name:         pulumi.String("hns-enabled-bucket"),
			Location:     pulumi.String("US"),
			ForceDestroy: pulumi.Bool(true),
			HierarchicalNamespace: &storage.BucketHierarchicalNamespaceArgs{
				Enabled: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_storage_bucket" "hns-enabled" {
  name          = "hns-enabled-bucket"
  location      = "US"
  force_destroy = true
  hierarchical_namespace = {
    enabled = true
  }
}
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.BucketHierarchicalNamespaceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 hns_enabled = new Bucket("hns-enabled", BucketArgs.builder()
            .name("hns-enabled-bucket")
            .location("US")
            .forceDestroy(true)
            .hierarchicalNamespace(BucketHierarchicalNamespaceArgs.builder()
                .enabled(true)
                .build())
            .build());

    }
}
resources:
  hns-enabled:
    type: gcp:storage:Bucket
    properties:
      name: hns-enabled-bucket
      location: US
      forceDestroy: true
      hierarchicalNamespace:
        enabled: true

IP Filter Mode Enabled

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const hns_enabled = new gcp.storage.Bucket("hns-enabled", {
    name: "hns-enabled-bucket",
    location: "US",
    forceDestroy: true,
    ipFilter: {
        mode: "Enabled",
        publicNetworkSource: {
            allowedIpCidrRanges: [
                "0.0.0.0/0",
                "::/0",
            ],
        },
    },
});
import pulumi
import pulumi_gcp as gcp

hns_enabled = gcp.storage.Bucket("hns-enabled",
    name="hns-enabled-bucket",
    location="US",
    force_destroy=True,
    ip_filter={
        "mode": "Enabled",
        "public_network_source": {
            "allowed_ip_cidr_ranges": [
                "0.0.0.0/0",
                "::/0",
            ],
        },
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var hns_enabled = new Gcp.Storage.Bucket("hns-enabled", new()
    {
        Name = "hns-enabled-bucket",
        Location = "US",
        ForceDestroy = true,
        IpFilter = new Gcp.Storage.Inputs.BucketIpFilterArgs
        {
            Mode = "Enabled",
            PublicNetworkSource = new Gcp.Storage.Inputs.BucketIpFilterPublicNetworkSourceArgs
            {
                AllowedIpCidrRanges = new[]
                {
                    "0.0.0.0/0",
                    "::/0",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := storage.NewBucket(ctx, "hns-enabled", &storage.BucketArgs{
			Name:         pulumi.String("hns-enabled-bucket"),
			Location:     pulumi.String("US"),
			ForceDestroy: pulumi.Bool(true),
			IpFilter: &storage.BucketIpFilterArgs{
				Mode: pulumi.String("Enabled"),
				PublicNetworkSource: &storage.BucketIpFilterPublicNetworkSourceArgs{
					AllowedIpCidrRanges: pulumi.StringArray{
						pulumi.String("0.0.0.0/0"),
						pulumi.String("::/0"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_storage_bucket" "hns-enabled" {
  name          = "hns-enabled-bucket"
  location      = "US"
  force_destroy = true
  ip_filter = {
    mode = "Enabled"
    public_network_source = {
      allowed_ip_cidr_ranges = ["0.0.0.0/0", "::/0"]
    }
  }
}
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.BucketIpFilterArgs;
import com.pulumi.gcp.storage.inputs.BucketIpFilterPublicNetworkSourceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 hns_enabled = new Bucket("hns-enabled", BucketArgs.builder()
            .name("hns-enabled-bucket")
            .location("US")
            .forceDestroy(true)
            .ipFilter(BucketIpFilterArgs.builder()
                .mode("Enabled")
                .publicNetworkSource(BucketIpFilterPublicNetworkSourceArgs.builder()
                    .allowedIpCidrRanges(
                        "0.0.0.0/0",
                        "::/0")
                    .build())
                .build())
            .build());

    }
}
resources:
  hns-enabled:
    type: gcp:storage:Bucket
    properties:
      name: hns-enabled-bucket
      location: US
      forceDestroy: true
      ipFilter:
        mode: Enabled
        publicNetworkSource:
          allowedIpCidrRanges:
            - 0.0.0.0/0
            - ::/0

IP Filter Mode Disabled

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const hns_enabled = new gcp.storage.Bucket("hns-enabled", {
    name: "hns-enabled-bucket",
    location: "US",
    forceDestroy: true,
    ipFilter: {
        mode: "Disabled",
        publicNetworkSource: {
            allowedIpCidrRanges: [
                "0.0.0.0/0",
                "::/0",
            ],
        },
    },
});
import pulumi
import pulumi_gcp as gcp

hns_enabled = gcp.storage.Bucket("hns-enabled",
    name="hns-enabled-bucket",
    location="US",
    force_destroy=True,
    ip_filter={
        "mode": "Disabled",
        "public_network_source": {
            "allowed_ip_cidr_ranges": [
                "0.0.0.0/0",
                "::/0",
            ],
        },
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var hns_enabled = new Gcp.Storage.Bucket("hns-enabled", new()
    {
        Name = "hns-enabled-bucket",
        Location = "US",
        ForceDestroy = true,
        IpFilter = new Gcp.Storage.Inputs.BucketIpFilterArgs
        {
            Mode = "Disabled",
            PublicNetworkSource = new Gcp.Storage.Inputs.BucketIpFilterPublicNetworkSourceArgs
            {
                AllowedIpCidrRanges = new[]
                {
                    "0.0.0.0/0",
                    "::/0",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := storage.NewBucket(ctx, "hns-enabled", &storage.BucketArgs{
			Name:         pulumi.String("hns-enabled-bucket"),
			Location:     pulumi.String("US"),
			ForceDestroy: pulumi.Bool(true),
			IpFilter: &storage.BucketIpFilterArgs{
				Mode: pulumi.String("Disabled"),
				PublicNetworkSource: &storage.BucketIpFilterPublicNetworkSourceArgs{
					AllowedIpCidrRanges: pulumi.StringArray{
						pulumi.String("0.0.0.0/0"),
						pulumi.String("::/0"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_storage_bucket" "hns-enabled" {
  name          = "hns-enabled-bucket"
  location      = "US"
  force_destroy = true
  ip_filter = {
    mode = "Disabled"
    public_network_source = {
      allowed_ip_cidr_ranges = ["0.0.0.0/0", "::/0"]
    }
  }
}
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.BucketIpFilterArgs;
import com.pulumi.gcp.storage.inputs.BucketIpFilterPublicNetworkSourceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 hns_enabled = new Bucket("hns-enabled", BucketArgs.builder()
            .name("hns-enabled-bucket")
            .location("US")
            .forceDestroy(true)
            .ipFilter(BucketIpFilterArgs.builder()
                .mode("Disabled")
                .publicNetworkSource(BucketIpFilterPublicNetworkSourceArgs.builder()
                    .allowedIpCidrRanges(
                        "0.0.0.0/0",
                        "::/0")
                    .build())
                .build())
            .build());

    }
}
resources:
  hns-enabled:
    type: gcp:storage:Bucket
    properties:
      name: hns-enabled-bucket
      location: US
      forceDestroy: true
      ipFilter:
        mode: Disabled
        publicNetworkSource:
          allowedIpCidrRanges:
            - 0.0.0.0/0
            - ::/0

Enabling Encryption Enforcement Config

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const hns_enabled = new gcp.storage.Bucket("hns-enabled", {
    name: "hns-enabled-bucket",
    location: "US",
    forceDestroy: true,
    encryption: {
        googleManagedEncryptionEnforcementConfig: {
            restrictionMode: "FullyRestricted",
        },
        customerManagedEncryptionEnforcementConfig: {
            restrictionMode: "FullyRestricted",
        },
        customerSuppliedEncryptionEnforcementConfig: {
            restrictionMode: "NotRestricted",
        },
    },
});
import pulumi
import pulumi_gcp as gcp

hns_enabled = gcp.storage.Bucket("hns-enabled",
    name="hns-enabled-bucket",
    location="US",
    force_destroy=True,
    encryption={
        "google_managed_encryption_enforcement_config": {
            "restriction_mode": "FullyRestricted",
        },
        "customer_managed_encryption_enforcement_config": {
            "restriction_mode": "FullyRestricted",
        },
        "customer_supplied_encryption_enforcement_config": {
            "restriction_mode": "NotRestricted",
        },
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var hns_enabled = new Gcp.Storage.Bucket("hns-enabled", new()
    {
        Name = "hns-enabled-bucket",
        Location = "US",
        ForceDestroy = true,
        Encryption = new Gcp.Storage.Inputs.BucketEncryptionArgs
        {
            GoogleManagedEncryptionEnforcementConfig = new Gcp.Storage.Inputs.BucketEncryptionGoogleManagedEncryptionEnforcementConfigArgs
            {
                RestrictionMode = "FullyRestricted",
            },
            CustomerManagedEncryptionEnforcementConfig = new Gcp.Storage.Inputs.BucketEncryptionCustomerManagedEncryptionEnforcementConfigArgs
            {
                RestrictionMode = "FullyRestricted",
            },
            CustomerSuppliedEncryptionEnforcementConfig = new Gcp.Storage.Inputs.BucketEncryptionCustomerSuppliedEncryptionEnforcementConfigArgs
            {
                RestrictionMode = "NotRestricted",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := storage.NewBucket(ctx, "hns-enabled", &storage.BucketArgs{
			Name:         pulumi.String("hns-enabled-bucket"),
			Location:     pulumi.String("US"),
			ForceDestroy: pulumi.Bool(true),
			Encryption: &storage.BucketEncryptionArgs{
				GoogleManagedEncryptionEnforcementConfig: &storage.BucketEncryptionGoogleManagedEncryptionEnforcementConfigArgs{
					RestrictionMode: pulumi.String("FullyRestricted"),
				},
				CustomerManagedEncryptionEnforcementConfig: &storage.BucketEncryptionCustomerManagedEncryptionEnforcementConfigArgs{
					RestrictionMode: pulumi.String("FullyRestricted"),
				},
				CustomerSuppliedEncryptionEnforcementConfig: &storage.BucketEncryptionCustomerSuppliedEncryptionEnforcementConfigArgs{
					RestrictionMode: pulumi.String("NotRestricted"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_storage_bucket" "hns-enabled" {
  name          = "hns-enabled-bucket"
  location      = "US"
  force_destroy = true
  encryption = {
    google_managed_encryption_enforcement_config = {
      restriction_mode = "FullyRestricted"
    }
    customer_managed_encryption_enforcement_config = {
      restriction_mode = "FullyRestricted"
    }
    customer_supplied_encryption_enforcement_config = {
      restriction_mode = "NotRestricted"
    }
  }
}
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.BucketEncryptionArgs;
import com.pulumi.gcp.storage.inputs.BucketEncryptionGoogleManagedEncryptionEnforcementConfigArgs;
import com.pulumi.gcp.storage.inputs.BucketEncryptionCustomerManagedEncryptionEnforcementConfigArgs;
import com.pulumi.gcp.storage.inputs.BucketEncryptionCustomerSuppliedEncryptionEnforcementConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 hns_enabled = new Bucket("hns-enabled", BucketArgs.builder()
            .name("hns-enabled-bucket")
            .location("US")
            .forceDestroy(true)
            .encryption(BucketEncryptionArgs.builder()
                .googleManagedEncryptionEnforcementConfig(BucketEncryptionGoogleManagedEncryptionEnforcementConfigArgs.builder()
                    .restrictionMode("FullyRestricted")
                    .build())
                .customerManagedEncryptionEnforcementConfig(BucketEncryptionCustomerManagedEncryptionEnforcementConfigArgs.builder()
                    .restrictionMode("FullyRestricted")
                    .build())
                .customerSuppliedEncryptionEnforcementConfig(BucketEncryptionCustomerSuppliedEncryptionEnforcementConfigArgs.builder()
                    .restrictionMode("NotRestricted")
                    .build())
                .build())
            .build());

    }
}
resources:
  hns-enabled:
    type: gcp:storage:Bucket
    properties:
      name: hns-enabled-bucket
      location: US
      forceDestroy: true
      encryption:
        googleManagedEncryptionEnforcementConfig:
          restrictionMode: FullyRestricted
        customerManagedEncryptionEnforcementConfig:
          restrictionMode: FullyRestricted
        customerSuppliedEncryptionEnforcementConfig:
          restrictionMode: NotRestricted

Enabling RAPID Storage Bucket

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const zonalBucket = new gcp.storage.Bucket("zonal_bucket", {
    location: "US-CENTRAL1",
    customPlacementConfig: {
        dataLocations: ["US-CENTRAL1-B"],
    },
    name: "zonal-rapid-bucket",
    storageClass: "RAPID",
    hierarchicalNamespace: {
        enabled: true,
    },
});
import pulumi
import pulumi_gcp as gcp

zonal_bucket = gcp.storage.Bucket("zonal_bucket",
    location="US-CENTRAL1",
    custom_placement_config={
        "data_locations": ["US-CENTRAL1-B"],
    },
    name="zonal-rapid-bucket",
    storage_class="RAPID",
    hierarchical_namespace={
        "enabled": True,
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var zonalBucket = new Gcp.Storage.Bucket("zonal_bucket", new()
    {
        Location = "US-CENTRAL1",
        CustomPlacementConfig = new Gcp.Storage.Inputs.BucketCustomPlacementConfigArgs
        {
            DataLocations = new[]
            {
                "US-CENTRAL1-B",
            },
        },
        Name = "zonal-rapid-bucket",
        StorageClass = "RAPID",
        HierarchicalNamespace = new Gcp.Storage.Inputs.BucketHierarchicalNamespaceArgs
        {
            Enabled = true,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := storage.NewBucket(ctx, "zonal_bucket", &storage.BucketArgs{
			Location: pulumi.String("US-CENTRAL1"),
			CustomPlacementConfig: &storage.BucketCustomPlacementConfigArgs{
				DataLocations: pulumi.StringArray{
					pulumi.String("US-CENTRAL1-B"),
				},
			},
			Name:         pulumi.String("zonal-rapid-bucket"),
			StorageClass: pulumi.String("RAPID"),
			HierarchicalNamespace: &storage.BucketHierarchicalNamespaceArgs{
				Enabled: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_storage_bucket" "zonal_bucket" {
  location = "US-CENTRAL1"
  custom_placement_config = {
    data_locations = ["US-CENTRAL1-B"]
  }
  name          = "zonal-rapid-bucket"
  storage_class = "RAPID"
  hierarchical_namespace = {
    enabled = true
  }
}
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.BucketCustomPlacementConfigArgs;
import com.pulumi.gcp.storage.inputs.BucketHierarchicalNamespaceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 zonalBucket = new Bucket("zonalBucket", BucketArgs.builder()
            .location("US-CENTRAL1")
            .customPlacementConfig(BucketCustomPlacementConfigArgs.builder()
                .dataLocations("US-CENTRAL1-B")
                .build())
            .name("zonal-rapid-bucket")
            .storageClass("RAPID")
            .hierarchicalNamespace(BucketHierarchicalNamespaceArgs.builder()
                .enabled(true)
                .build())
            .build());

    }
}
resources:
  zonalBucket:
    type: gcp:storage:Bucket
    name: zonal_bucket
    properties:
      location: US-CENTRAL1
      customPlacementConfig:
        dataLocations:
          - US-CENTRAL1-B
      name: zonal-rapid-bucket
      storageClass: RAPID
      hierarchicalNamespace:
        enabled: true

Constructors

Bucket(String name, {BucketArgs? args, CustomResourceOptions? options})
Creates a new Bucket. name The Pulumi resource name. args Arguments used to configure this Bucket. The set of arguments for Bucket. options Resource options controlling this resource's behavior.
Bucket.reference(String urn)
Creates a typed reference to an existing Bucket resource.

Properties

autoclass ↔ Output<BucketAutoclass?>
The bucket's Autoclass configuration. Structure is documented below.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
cors ↔ Output<List<BucketCor>?>
The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
latefinal
customPlacementConfig ↔ Output<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.
latefinal
defaultEventBasedHold ↔ Output<bool?>
Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to "DELETE". When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
effectiveLabels ↔ Output<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.
latefinal
enableObjectRetention ↔ Output<bool?>
Enables object retention on a storage bucket.
latefinal
encryption ↔ Output<BucketEncryption?>
The bucket's encryption configuration. Structure is documented below.
latefinal
forceDestroy ↔ Output<bool?>
When true, before deleting a bucket, delete all objects within the bucket, or Anywhere Caches caching data for that bucket. Otherwise, buckets with objects/caches will fail. Anywhere Cache requires additional permissions to interact with and will be assumed not present when the provider is not permissioned, attempting to delete the bucket anyways. This may result in the objects in the bucket getting destroyed but not the bucket itself if there is a cache in use with the bucket. Force deletion may take a long time to delete buckets with lots of objects or with any Anywhere Caches (80m+).
latefinal
hashCode → int
The hash code for this object.
no setterinherited
hierarchicalNamespace ↔ Output<BucketHierarchicalNamespace?>
The bucket's hierarchical namespace policy, which defines the bucket capability to handle folders in logical structure. Structure is documented below. To use this configuration, uniformBucketLevelAccess must be enabled on bucket.
latefinal
id ↔ Output<String>
getter/setter pairinherited
ipFilter ↔ Output<BucketIpFilter?>
The bucket IP filtering configuration. Specifies the network sources that can access the bucket, as well as its underlying objects. Structure is documented below.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
labels ↔ Output<Map<String, String>?>
A map of key/value label pairs to assign to the bucket.
latefinal
lifecycleRules ↔ Output<List<BucketLifecycleRule>?>
The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
latefinal
location ↔ Output<String>
The GCS location.
latefinal
logging ↔ Output<BucketLogging?>
The bucket's Access & Storage Logs configuration. Structure is documented below.
latefinal
name ↔ Output<String>
The name of the bucket. Bucket names must be in lowercase and no more than 63 characters long. You can find the complete list of bucket naming rules here.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
projectNumber ↔ Output<int>
The project number of the project in which the resource belongs.
latefinal
publicAccessPrevention ↔ Output<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".
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
requesterPays ↔ Output<bool?>
Enables Requester Pays on a storage bucket.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
retentionPolicy ↔ Output<BucketRetentionPolicy?>
Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
latefinal
rpo ↔ Output<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.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
The URI of the created resource.
latefinal
softDeletePolicy ↔ Output<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 the block is not provided, Server side value will be kept which means removal of block won't generate any terraform change. Structure is documented below.
latefinal
storageClass ↔ Output<String?>
The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.
latefinal
timeCreated ↔ Output<String>
The creation time of the bucket in RFC 3339 format.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
uniformBucketLevelAccess ↔ Output<bool>
Enables Uniform bucket-level access access to a bucket.
latefinal
updated ↔ Output<String>
The time at which the bucket's metadata or IAM policy was last updated, in RFC 3339 format.
latefinal
url ↔ Output<String>
The base URL of the bucket, in the format gs://&lt;bucket-name&gt;.
latefinal
urn ↔ Output<String>
latefinalinherited
versioning ↔ Output<BucketVersioning>
The bucket's Versioning configuration. Structure is documented below.
latefinal
website ↔ Output<BucketWebsite>
Configuration if the bucket acts as a website. Structure is documented below.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {BucketState? state, CustomResourceOptions? options}) → Bucket
Gets an existing Bucket resource's state with the given name and id.