gcp.storage.Bucket
Explore with Pulumi AI
Creates a new bucket in Google cloud storage service (GCS). Once a bucket has been created, its location can’t be changed.
For more information see the official documentation and API.
Note: If the project id is not set on the resource or in the provider block it will be dynamically determined which will require enabling the compute api.
Example Usage
Creating A Private Bucket In Standard Storage, In The EU Region. Bucket Configured As Static Website And CORS Configurations
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const static_site = new gcp.storage.Bucket("static-site", {
name: "image-store.com",
location: "EU",
forceDestroy: true,
uniformBucketLevelAccess: true,
website: {
mainPageSuffix: "index.html",
notFoundPage: "404.html",
},
cors: [{
origins: ["http://image-store.com"],
methods: [
"GET",
"HEAD",
"PUT",
"POST",
"DELETE",
],
responseHeaders: ["*"],
maxAgeSeconds: 3600,
}],
});
import pulumi
import pulumi_gcp as gcp
static_site = gcp.storage.Bucket("static-site",
name="image-store.com",
location="EU",
force_destroy=True,
uniform_bucket_level_access=True,
website={
"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,
}])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewBucket(ctx, "static-site", &storage.BucketArgs{
Name: pulumi.String("image-store.com"),
Location: pulumi.String("EU"),
ForceDestroy: pulumi.Bool(true),
UniformBucketLevelAccess: pulumi.Bool(true),
Website: &storage.BucketWebsiteArgs{
MainPageSuffix: pulumi.String("index.html"),
NotFoundPage: pulumi.String("404.html"),
},
Cors: storage.BucketCorArray{
&storage.BucketCorArgs{
Origins: pulumi.StringArray{
pulumi.String("http://image-store.com"),
},
Methods: pulumi.StringArray{
pulumi.String("GET"),
pulumi.String("HEAD"),
pulumi.String("PUT"),
pulumi.String("POST"),
pulumi.String("DELETE"),
},
ResponseHeaders: pulumi.StringArray{
pulumi.String("*"),
},
MaxAgeSeconds: pulumi.Int(3600),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var static_site = new Gcp.Storage.Bucket("static-site", new()
{
Name = "image-store.com",
Location = "EU",
ForceDestroy = true,
UniformBucketLevelAccess = true,
Website = new Gcp.Storage.Inputs.BucketWebsiteArgs
{
MainPageSuffix = "index.html",
NotFoundPage = "404.html",
},
Cors = new[]
{
new Gcp.Storage.Inputs.BucketCorArgs
{
Origins = new[]
{
"http://image-store.com",
},
Methods = new[]
{
"GET",
"HEAD",
"PUT",
"POST",
"DELETE",
},
ResponseHeaders = new[]
{
"*",
},
MaxAgeSeconds = 3600,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.storage.inputs.BucketWebsiteArgs;
import com.pulumi.gcp.storage.inputs.BucketCorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var static_site = new Bucket("static-site", BucketArgs.builder()
.name("image-store.com")
.location("EU")
.forceDestroy(true)
.uniformBucketLevelAccess(true)
.website(BucketWebsiteArgs.builder()
.mainPageSuffix("index.html")
.notFoundPage("404.html")
.build())
.cors(BucketCorArgs.builder()
.origins("http://image-store.com")
.methods(
"GET",
"HEAD",
"PUT",
"POST",
"DELETE")
.responseHeaders("*")
.maxAgeSeconds(3600)
.build())
.build());
}
}
resources:
static-site:
type: gcp:storage:Bucket
properties:
name: image-store.com
location: EU
forceDestroy: true
uniformBucketLevelAccess: true
website:
mainPageSuffix: index.html
notFoundPage: 404.html
cors:
- origins:
- http://image-store.com
methods:
- GET
- HEAD
- PUT
- POST
- DELETE
responseHeaders:
- '*'
maxAgeSeconds: 3600
Life Cycle Settings For Storage Bucket Objects
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const auto_expire = new gcp.storage.Bucket("auto-expire", {
name: "auto-expiring-bucket",
location: "US",
forceDestroy: true,
lifecycleRules: [
{
condition: {
age: 3,
},
action: {
type: "Delete",
},
},
{
condition: {
age: 1,
},
action: {
type: "AbortIncompleteMultipartUpload",
},
},
],
});
import pulumi
import pulumi_gcp as gcp
auto_expire = gcp.storage.Bucket("auto-expire",
name="auto-expiring-bucket",
location="US",
force_destroy=True,
lifecycle_rules=[
{
"condition": {
"age": 3,
},
"action": {
"type": "Delete",
},
},
{
"condition": {
"age": 1,
},
"action": {
"type": "AbortIncompleteMultipartUpload",
},
},
])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewBucket(ctx, "auto-expire", &storage.BucketArgs{
Name: pulumi.String("auto-expiring-bucket"),
Location: pulumi.String("US"),
ForceDestroy: pulumi.Bool(true),
LifecycleRules: storage.BucketLifecycleRuleArray{
&storage.BucketLifecycleRuleArgs{
Condition: &storage.BucketLifecycleRuleConditionArgs{
Age: pulumi.Int(3),
},
Action: &storage.BucketLifecycleRuleActionArgs{
Type: pulumi.String("Delete"),
},
},
&storage.BucketLifecycleRuleArgs{
Condition: &storage.BucketLifecycleRuleConditionArgs{
Age: pulumi.Int(1),
},
Action: &storage.BucketLifecycleRuleActionArgs{
Type: pulumi.String("AbortIncompleteMultipartUpload"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var auto_expire = new Gcp.Storage.Bucket("auto-expire", new()
{
Name = "auto-expiring-bucket",
Location = "US",
ForceDestroy = true,
LifecycleRules = new[]
{
new Gcp.Storage.Inputs.BucketLifecycleRuleArgs
{
Condition = new Gcp.Storage.Inputs.BucketLifecycleRuleConditionArgs
{
Age = 3,
},
Action = new Gcp.Storage.Inputs.BucketLifecycleRuleActionArgs
{
Type = "Delete",
},
},
new Gcp.Storage.Inputs.BucketLifecycleRuleArgs
{
Condition = new Gcp.Storage.Inputs.BucketLifecycleRuleConditionArgs
{
Age = 1,
},
Action = new Gcp.Storage.Inputs.BucketLifecycleRuleActionArgs
{
Type = "AbortIncompleteMultipartUpload",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.storage.inputs.BucketLifecycleRuleArgs;
import com.pulumi.gcp.storage.inputs.BucketLifecycleRuleConditionArgs;
import com.pulumi.gcp.storage.inputs.BucketLifecycleRuleActionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var auto_expire = new Bucket("auto-expire", BucketArgs.builder()
.name("auto-expiring-bucket")
.location("US")
.forceDestroy(true)
.lifecycleRules(
BucketLifecycleRuleArgs.builder()
.condition(BucketLifecycleRuleConditionArgs.builder()
.age(3)
.build())
.action(BucketLifecycleRuleActionArgs.builder()
.type("Delete")
.build())
.build(),
BucketLifecycleRuleArgs.builder()
.condition(BucketLifecycleRuleConditionArgs.builder()
.age(1)
.build())
.action(BucketLifecycleRuleActionArgs.builder()
.type("AbortIncompleteMultipartUpload")
.build())
.build())
.build());
}
}
resources:
auto-expire:
type: gcp:storage:Bucket
properties:
name: auto-expiring-bucket
location: US
forceDestroy: true
lifecycleRules:
- condition:
age: 3
action:
type: Delete
- condition:
age: 1
action:
type: AbortIncompleteMultipartUpload
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 send_age_if_zero
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,
},
}])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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 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)
.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 auto_expire = new gcp.storage.Bucket("auto-expire", {
name: "no-public-access-bucket",
location: "US",
forceDestroy: true,
publicAccessPrevention: "enforced",
});
import pulumi
import pulumi_gcp as gcp
auto_expire = gcp.storage.Bucket("auto-expire",
name="no-public-access-bucket",
location="US",
force_destroy=True,
public_access_prevention="enforced")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewBucket(ctx, "auto-expire", &storage.BucketArgs{
Name: pulumi.String("no-public-access-bucket"),
Location: pulumi.String("US"),
ForceDestroy: pulumi.Bool(true),
PublicAccessPrevention: pulumi.String("enforced"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var auto_expire = new Gcp.Storage.Bucket("auto-expire", new()
{
Name = "no-public-access-bucket",
Location = "US",
ForceDestroy = true,
PublicAccessPrevention = "enforced",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var auto_expire = new Bucket("auto-expire", BucketArgs.builder()
.name("no-public-access-bucket")
.location("US")
.forceDestroy(true)
.publicAccessPrevention("enforced")
.build());
}
}
resources:
auto-expire:
type: gcp:storage:Bucket
properties:
name: no-public-access-bucket
location: US
forceDestroy: true
publicAccessPrevention: enforced
Create Bucket Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Bucket(name: string, args: BucketArgs, opts?: CustomResourceOptions);
@overload
def Bucket(resource_name: str,
args: BucketArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Bucket(resource_name: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
logging: Optional[BucketLoggingArgs] = None,
encryption: Optional[BucketEncryptionArgs] = None,
name: Optional[str] = None,
public_access_prevention: Optional[str] = None,
project: Optional[str] = None,
force_destroy: Optional[bool] = None,
labels: Optional[Mapping[str, str]] = None,
lifecycle_rules: Optional[Sequence[BucketLifecycleRuleArgs]] = None,
cors: Optional[Sequence[BucketCorArgs]] = None,
autoclass: Optional[BucketAutoclassArgs] = None,
default_event_based_hold: Optional[bool] = None,
custom_placement_config: Optional[BucketCustomPlacementConfigArgs] = None,
enable_object_retention: Optional[bool] = None,
requester_pays: Optional[bool] = None,
retention_policy: Optional[BucketRetentionPolicyArgs] = None,
rpo: Optional[str] = None,
soft_delete_policy: Optional[BucketSoftDeletePolicyArgs] = None,
storage_class: Optional[str] = None,
uniform_bucket_level_access: Optional[bool] = None,
versioning: Optional[BucketVersioningArgs] = None,
website: Optional[BucketWebsiteArgs] = None)
func NewBucket(ctx *Context, name string, args BucketArgs, opts ...ResourceOption) (*Bucket, error)
public Bucket(string name, BucketArgs args, CustomResourceOptions? opts = null)
public Bucket(String name, BucketArgs args)
public Bucket(String name, BucketArgs args, CustomResourceOptions options)
type: gcp:storage:Bucket
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BucketArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args BucketArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BucketArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BucketArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var bucketResource = new Gcp.Storage.Bucket("bucketResource", new()
{
Location = "string",
Logging = new Gcp.Storage.Inputs.BucketLoggingArgs
{
LogBucket = "string",
LogObjectPrefix = "string",
},
Encryption = new Gcp.Storage.Inputs.BucketEncryptionArgs
{
DefaultKmsKeyName = "string",
},
Name = "string",
PublicAccessPrevention = "string",
Project = "string",
ForceDestroy = false,
Labels =
{
{ "string", "string" },
},
LifecycleRules = new[]
{
new Gcp.Storage.Inputs.BucketLifecycleRuleArgs
{
Action = new Gcp.Storage.Inputs.BucketLifecycleRuleActionArgs
{
Type = "string",
StorageClass = "string",
},
Condition = new Gcp.Storage.Inputs.BucketLifecycleRuleConditionArgs
{
Age = 0,
CreatedBefore = "string",
CustomTimeBefore = "string",
DaysSinceCustomTime = 0,
DaysSinceNoncurrentTime = 0,
MatchesPrefixes = new[]
{
"string",
},
MatchesStorageClasses = new[]
{
"string",
},
MatchesSuffixes = new[]
{
"string",
},
NoncurrentTimeBefore = "string",
NumNewerVersions = 0,
SendAgeIfZero = false,
SendDaysSinceCustomTimeIfZero = false,
SendDaysSinceNoncurrentTimeIfZero = false,
SendNumNewerVersionsIfZero = false,
WithState = "string",
},
},
},
Cors = new[]
{
new Gcp.Storage.Inputs.BucketCorArgs
{
MaxAgeSeconds = 0,
Methods = new[]
{
"string",
},
Origins = new[]
{
"string",
},
ResponseHeaders = new[]
{
"string",
},
},
},
Autoclass = new Gcp.Storage.Inputs.BucketAutoclassArgs
{
Enabled = false,
TerminalStorageClass = "string",
},
DefaultEventBasedHold = false,
CustomPlacementConfig = new Gcp.Storage.Inputs.BucketCustomPlacementConfigArgs
{
DataLocations = new[]
{
"string",
},
},
EnableObjectRetention = false,
RequesterPays = false,
RetentionPolicy = new Gcp.Storage.Inputs.BucketRetentionPolicyArgs
{
RetentionPeriod = 0,
IsLocked = false,
},
Rpo = "string",
SoftDeletePolicy = new Gcp.Storage.Inputs.BucketSoftDeletePolicyArgs
{
EffectiveTime = "string",
RetentionDurationSeconds = 0,
},
StorageClass = "string",
UniformBucketLevelAccess = false,
Versioning = new Gcp.Storage.Inputs.BucketVersioningArgs
{
Enabled = false,
},
Website = new Gcp.Storage.Inputs.BucketWebsiteArgs
{
MainPageSuffix = "string",
NotFoundPage = "string",
},
});
example, err := storage.NewBucket(ctx, "bucketResource", &storage.BucketArgs{
Location: pulumi.String("string"),
Logging: &storage.BucketLoggingArgs{
LogBucket: pulumi.String("string"),
LogObjectPrefix: pulumi.String("string"),
},
Encryption: &storage.BucketEncryptionArgs{
DefaultKmsKeyName: pulumi.String("string"),
},
Name: pulumi.String("string"),
PublicAccessPrevention: pulumi.String("string"),
Project: pulumi.String("string"),
ForceDestroy: pulumi.Bool(false),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
LifecycleRules: storage.BucketLifecycleRuleArray{
&storage.BucketLifecycleRuleArgs{
Action: &storage.BucketLifecycleRuleActionArgs{
Type: pulumi.String("string"),
StorageClass: pulumi.String("string"),
},
Condition: &storage.BucketLifecycleRuleConditionArgs{
Age: pulumi.Int(0),
CreatedBefore: pulumi.String("string"),
CustomTimeBefore: pulumi.String("string"),
DaysSinceCustomTime: pulumi.Int(0),
DaysSinceNoncurrentTime: pulumi.Int(0),
MatchesPrefixes: pulumi.StringArray{
pulumi.String("string"),
},
MatchesStorageClasses: pulumi.StringArray{
pulumi.String("string"),
},
MatchesSuffixes: pulumi.StringArray{
pulumi.String("string"),
},
NoncurrentTimeBefore: pulumi.String("string"),
NumNewerVersions: pulumi.Int(0),
SendAgeIfZero: pulumi.Bool(false),
SendDaysSinceCustomTimeIfZero: pulumi.Bool(false),
SendDaysSinceNoncurrentTimeIfZero: pulumi.Bool(false),
SendNumNewerVersionsIfZero: pulumi.Bool(false),
WithState: pulumi.String("string"),
},
},
},
Cors: storage.BucketCorArray{
&storage.BucketCorArgs{
MaxAgeSeconds: pulumi.Int(0),
Methods: pulumi.StringArray{
pulumi.String("string"),
},
Origins: pulumi.StringArray{
pulumi.String("string"),
},
ResponseHeaders: pulumi.StringArray{
pulumi.String("string"),
},
},
},
Autoclass: &storage.BucketAutoclassArgs{
Enabled: pulumi.Bool(false),
TerminalStorageClass: pulumi.String("string"),
},
DefaultEventBasedHold: pulumi.Bool(false),
CustomPlacementConfig: &storage.BucketCustomPlacementConfigArgs{
DataLocations: pulumi.StringArray{
pulumi.String("string"),
},
},
EnableObjectRetention: pulumi.Bool(false),
RequesterPays: pulumi.Bool(false),
RetentionPolicy: &storage.BucketRetentionPolicyArgs{
RetentionPeriod: pulumi.Int(0),
IsLocked: pulumi.Bool(false),
},
Rpo: pulumi.String("string"),
SoftDeletePolicy: &storage.BucketSoftDeletePolicyArgs{
EffectiveTime: pulumi.String("string"),
RetentionDurationSeconds: pulumi.Int(0),
},
StorageClass: pulumi.String("string"),
UniformBucketLevelAccess: pulumi.Bool(false),
Versioning: &storage.BucketVersioningArgs{
Enabled: pulumi.Bool(false),
},
Website: &storage.BucketWebsiteArgs{
MainPageSuffix: pulumi.String("string"),
NotFoundPage: pulumi.String("string"),
},
})
var bucketResource = new Bucket("bucketResource", BucketArgs.builder()
.location("string")
.logging(BucketLoggingArgs.builder()
.logBucket("string")
.logObjectPrefix("string")
.build())
.encryption(BucketEncryptionArgs.builder()
.defaultKmsKeyName("string")
.build())
.name("string")
.publicAccessPrevention("string")
.project("string")
.forceDestroy(false)
.labels(Map.of("string", "string"))
.lifecycleRules(BucketLifecycleRuleArgs.builder()
.action(BucketLifecycleRuleActionArgs.builder()
.type("string")
.storageClass("string")
.build())
.condition(BucketLifecycleRuleConditionArgs.builder()
.age(0)
.createdBefore("string")
.customTimeBefore("string")
.daysSinceCustomTime(0)
.daysSinceNoncurrentTime(0)
.matchesPrefixes("string")
.matchesStorageClasses("string")
.matchesSuffixes("string")
.noncurrentTimeBefore("string")
.numNewerVersions(0)
.sendAgeIfZero(false)
.sendDaysSinceCustomTimeIfZero(false)
.sendDaysSinceNoncurrentTimeIfZero(false)
.sendNumNewerVersionsIfZero(false)
.withState("string")
.build())
.build())
.cors(BucketCorArgs.builder()
.maxAgeSeconds(0)
.methods("string")
.origins("string")
.responseHeaders("string")
.build())
.autoclass(BucketAutoclassArgs.builder()
.enabled(false)
.terminalStorageClass("string")
.build())
.defaultEventBasedHold(false)
.customPlacementConfig(BucketCustomPlacementConfigArgs.builder()
.dataLocations("string")
.build())
.enableObjectRetention(false)
.requesterPays(false)
.retentionPolicy(BucketRetentionPolicyArgs.builder()
.retentionPeriod(0)
.isLocked(false)
.build())
.rpo("string")
.softDeletePolicy(BucketSoftDeletePolicyArgs.builder()
.effectiveTime("string")
.retentionDurationSeconds(0)
.build())
.storageClass("string")
.uniformBucketLevelAccess(false)
.versioning(BucketVersioningArgs.builder()
.enabled(false)
.build())
.website(BucketWebsiteArgs.builder()
.mainPageSuffix("string")
.notFoundPage("string")
.build())
.build());
bucket_resource = gcp.storage.Bucket("bucketResource",
location="string",
logging={
"logBucket": "string",
"logObjectPrefix": "string",
},
encryption={
"defaultKmsKeyName": "string",
},
name="string",
public_access_prevention="string",
project="string",
force_destroy=False,
labels={
"string": "string",
},
lifecycle_rules=[{
"action": {
"type": "string",
"storageClass": "string",
},
"condition": {
"age": 0,
"createdBefore": "string",
"customTimeBefore": "string",
"daysSinceCustomTime": 0,
"daysSinceNoncurrentTime": 0,
"matchesPrefixes": ["string"],
"matchesStorageClasses": ["string"],
"matchesSuffixes": ["string"],
"noncurrentTimeBefore": "string",
"numNewerVersions": 0,
"sendAgeIfZero": False,
"sendDaysSinceCustomTimeIfZero": False,
"sendDaysSinceNoncurrentTimeIfZero": False,
"sendNumNewerVersionsIfZero": False,
"withState": "string",
},
}],
cors=[{
"maxAgeSeconds": 0,
"methods": ["string"],
"origins": ["string"],
"responseHeaders": ["string"],
}],
autoclass={
"enabled": False,
"terminalStorageClass": "string",
},
default_event_based_hold=False,
custom_placement_config={
"dataLocations": ["string"],
},
enable_object_retention=False,
requester_pays=False,
retention_policy={
"retentionPeriod": 0,
"isLocked": False,
},
rpo="string",
soft_delete_policy={
"effectiveTime": "string",
"retentionDurationSeconds": 0,
},
storage_class="string",
uniform_bucket_level_access=False,
versioning={
"enabled": False,
},
website={
"mainPageSuffix": "string",
"notFoundPage": "string",
})
const bucketResource = new gcp.storage.Bucket("bucketResource", {
location: "string",
logging: {
logBucket: "string",
logObjectPrefix: "string",
},
encryption: {
defaultKmsKeyName: "string",
},
name: "string",
publicAccessPrevention: "string",
project: "string",
forceDestroy: false,
labels: {
string: "string",
},
lifecycleRules: [{
action: {
type: "string",
storageClass: "string",
},
condition: {
age: 0,
createdBefore: "string",
customTimeBefore: "string",
daysSinceCustomTime: 0,
daysSinceNoncurrentTime: 0,
matchesPrefixes: ["string"],
matchesStorageClasses: ["string"],
matchesSuffixes: ["string"],
noncurrentTimeBefore: "string",
numNewerVersions: 0,
sendAgeIfZero: false,
sendDaysSinceCustomTimeIfZero: false,
sendDaysSinceNoncurrentTimeIfZero: false,
sendNumNewerVersionsIfZero: false,
withState: "string",
},
}],
cors: [{
maxAgeSeconds: 0,
methods: ["string"],
origins: ["string"],
responseHeaders: ["string"],
}],
autoclass: {
enabled: false,
terminalStorageClass: "string",
},
defaultEventBasedHold: false,
customPlacementConfig: {
dataLocations: ["string"],
},
enableObjectRetention: false,
requesterPays: false,
retentionPolicy: {
retentionPeriod: 0,
isLocked: false,
},
rpo: "string",
softDeletePolicy: {
effectiveTime: "string",
retentionDurationSeconds: 0,
},
storageClass: "string",
uniformBucketLevelAccess: false,
versioning: {
enabled: false,
},
website: {
mainPageSuffix: "string",
notFoundPage: "string",
},
});
type: gcp:storage:Bucket
properties:
autoclass:
enabled: false
terminalStorageClass: string
cors:
- maxAgeSeconds: 0
methods:
- string
origins:
- string
responseHeaders:
- string
customPlacementConfig:
dataLocations:
- string
defaultEventBasedHold: false
enableObjectRetention: false
encryption:
defaultKmsKeyName: string
forceDestroy: false
labels:
string: string
lifecycleRules:
- action:
storageClass: string
type: string
condition:
age: 0
createdBefore: string
customTimeBefore: string
daysSinceCustomTime: 0
daysSinceNoncurrentTime: 0
matchesPrefixes:
- string
matchesStorageClasses:
- string
matchesSuffixes:
- string
noncurrentTimeBefore: string
numNewerVersions: 0
sendAgeIfZero: false
sendDaysSinceCustomTimeIfZero: false
sendDaysSinceNoncurrentTimeIfZero: false
sendNumNewerVersionsIfZero: false
withState: string
location: string
logging:
logBucket: string
logObjectPrefix: string
name: string
project: string
publicAccessPrevention: string
requesterPays: false
retentionPolicy:
isLocked: false
retentionPeriod: 0
rpo: string
softDeletePolicy:
effectiveTime: string
retentionDurationSeconds: 0
storageClass: string
uniformBucketLevelAccess: false
versioning:
enabled: false
website:
mainPageSuffix: string
notFoundPage: string
Bucket Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Bucket resource accepts the following input properties:
- Location string
- The GCS location.
- Autoclass
Bucket
Autoclass - The bucket's Autoclass configuration. Structure is documented below.
- Cors
List<Bucket
Cor> - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Custom
Placement BucketConfig Custom Placement Config - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- Default
Event boolBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- Enable
Object boolRetention - Enables object retention on a storage bucket.
- Encryption
Bucket
Encryption - The bucket's encryption configuration. Structure is documented below.
- Force
Destroy bool - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- Labels Dictionary<string, string>
- A map of key/value label pairs to assign to the bucket.
- Lifecycle
Rules List<BucketLifecycle Rule> - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Logging
Bucket
Logging - The bucket's Access & Storage Logs configuration. Structure is documented below.
- Name string
- The name of the bucket.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Public
Access stringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- Requester
Pays bool - Enables Requester Pays on a storage bucket.
- Retention
Policy BucketRetention Policy - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- Rpo string
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - Soft
Delete BucketPolicy Soft Delete Policy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- Storage
Class string - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - Uniform
Bucket boolLevel Access - Enables Uniform bucket-level access access to a bucket.
- Versioning
Bucket
Versioning - The bucket's Versioning configuration. Structure is documented below.
- Website
Bucket
Website - Configuration if the bucket acts as a website. Structure is documented below.
- Location string
- The GCS location.
- Autoclass
Bucket
Autoclass Args - The bucket's Autoclass configuration. Structure is documented below.
- Cors
[]Bucket
Cor Args - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Custom
Placement BucketConfig Custom Placement Config Args - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- Default
Event boolBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- Enable
Object boolRetention - Enables object retention on a storage bucket.
- Encryption
Bucket
Encryption Args - The bucket's encryption configuration. Structure is documented below.
- Force
Destroy bool - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- Labels map[string]string
- A map of key/value label pairs to assign to the bucket.
- Lifecycle
Rules []BucketLifecycle Rule Args - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Logging
Bucket
Logging Args - The bucket's Access & Storage Logs configuration. Structure is documented below.
- Name string
- The name of the bucket.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Public
Access stringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- Requester
Pays bool - Enables Requester Pays on a storage bucket.
- Retention
Policy BucketRetention Policy Args - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- Rpo string
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - Soft
Delete BucketPolicy Soft Delete Policy Args - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- Storage
Class string - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - Uniform
Bucket boolLevel Access - Enables Uniform bucket-level access access to a bucket.
- Versioning
Bucket
Versioning Args - The bucket's Versioning configuration. Structure is documented below.
- Website
Bucket
Website Args - Configuration if the bucket acts as a website. Structure is documented below.
- location String
- The GCS location.
- autoclass
Bucket
Autoclass - The bucket's Autoclass configuration. Structure is documented below.
- cors
List<Bucket
Cor> - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom
Placement BucketConfig Custom Placement Config - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default
Event BooleanBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- enable
Object BooleanRetention - Enables object retention on a storage bucket.
- encryption
Bucket
Encryption - The bucket's encryption configuration. Structure is documented below.
- force
Destroy Boolean - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels Map<String,String>
- A map of key/value label pairs to assign to the bucket.
- lifecycle
Rules List<BucketLifecycle Rule> - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- logging
Bucket
Logging - The bucket's Access & Storage Logs configuration. Structure is documented below.
- name String
- The name of the bucket.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- public
Access StringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- requester
Pays Boolean - Enables Requester Pays on a storage bucket.
- retention
Policy BucketRetention Policy - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo String
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - soft
Delete BucketPolicy Soft Delete Policy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage
Class String - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform
Bucket BooleanLevel Access - Enables Uniform bucket-level access access to a bucket.
- versioning
Bucket
Versioning - The bucket's Versioning configuration. Structure is documented below.
- website
Bucket
Website - Configuration if the bucket acts as a website. Structure is documented below.
- location string
- The GCS location.
- autoclass
Bucket
Autoclass - The bucket's Autoclass configuration. Structure is documented below.
- cors
Bucket
Cor[] - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom
Placement BucketConfig Custom Placement Config - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default
Event booleanBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- enable
Object booleanRetention - Enables object retention on a storage bucket.
- encryption
Bucket
Encryption - The bucket's encryption configuration. Structure is documented below.
- force
Destroy boolean - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels {[key: string]: string}
- A map of key/value label pairs to assign to the bucket.
- lifecycle
Rules BucketLifecycle Rule[] - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- logging
Bucket
Logging - The bucket's Access & Storage Logs configuration. Structure is documented below.
- name string
- The name of the bucket.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- public
Access stringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- requester
Pays boolean - Enables Requester Pays on a storage bucket.
- retention
Policy BucketRetention Policy - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo string
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - soft
Delete BucketPolicy Soft Delete Policy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage
Class string - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform
Bucket booleanLevel Access - Enables Uniform bucket-level access access to a bucket.
- versioning
Bucket
Versioning - The bucket's Versioning configuration. Structure is documented below.
- website
Bucket
Website - Configuration if the bucket acts as a website. Structure is documented below.
- location str
- The GCS location.
- autoclass
Bucket
Autoclass Args - The bucket's Autoclass configuration. Structure is documented below.
- cors
Sequence[Bucket
Cor Args] - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom_
placement_ Bucketconfig Custom Placement Config Args - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default_
event_ boolbased_ hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- enable_
object_ boolretention - Enables object retention on a storage bucket.
- encryption
Bucket
Encryption Args - The bucket's encryption configuration. Structure is documented below.
- force_
destroy bool - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels Mapping[str, str]
- A map of key/value label pairs to assign to the bucket.
- lifecycle_
rules Sequence[BucketLifecycle Rule Args] - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- logging
Bucket
Logging Args - The bucket's Access & Storage Logs configuration. Structure is documented below.
- name str
- The name of the bucket.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- public_
access_ strprevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- requester_
pays bool - Enables Requester Pays on a storage bucket.
- retention_
policy BucketRetention Policy Args - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo str
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - soft_
delete_ Bucketpolicy Soft Delete Policy Args - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage_
class str - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform_
bucket_ boollevel_ access - Enables Uniform bucket-level access access to a bucket.
- versioning
Bucket
Versioning Args - The bucket's Versioning configuration. Structure is documented below.
- website
Bucket
Website Args - Configuration if the bucket acts as a website. Structure is documented below.
- location String
- The GCS location.
- autoclass Property Map
- The bucket's Autoclass configuration. Structure is documented below.
- cors List<Property Map>
- The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom
Placement Property MapConfig - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default
Event BooleanBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- enable
Object BooleanRetention - Enables object retention on a storage bucket.
- encryption Property Map
- The bucket's encryption configuration. Structure is documented below.
- force
Destroy Boolean - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels Map<String>
- A map of key/value label pairs to assign to the bucket.
- lifecycle
Rules List<Property Map> - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- logging Property Map
- The bucket's Access & Storage Logs configuration. Structure is documented below.
- name String
- The name of the bucket.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- public
Access StringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- requester
Pays Boolean - Enables Requester Pays on a storage bucket.
- retention
Policy Property Map - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo String
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - soft
Delete Property MapPolicy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage
Class String - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform
Bucket BooleanLevel Access - Enables Uniform bucket-level access access to a bucket.
- versioning Property Map
- The bucket's Versioning configuration. Structure is documented below.
- website Property Map
- Configuration if the bucket acts as a website. Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Bucket resource produces the following output properties:
- Effective
Labels Dictionary<string, string> - Id string
- The provider-assigned unique ID for this managed resource.
- Project
Number int - The project number of the project in which the resource belongs.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - The URI of the created resource.
- Url string
- The base URL of the bucket, in the format
gs://<bucket-name>
.
- Effective
Labels map[string]string - Id string
- The provider-assigned unique ID for this managed resource.
- Project
Number int - The project number of the project in which the resource belongs.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - The URI of the created resource.
- Url string
- The base URL of the bucket, in the format
gs://<bucket-name>
.
- effective
Labels Map<String,String> - id String
- The provider-assigned unique ID for this managed resource.
- project
Number Integer - The project number of the project in which the resource belongs.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - The URI of the created resource.
- url String
- The base URL of the bucket, in the format
gs://<bucket-name>
.
- effective
Labels {[key: string]: string} - id string
- The provider-assigned unique ID for this managed resource.
- project
Number number - The project number of the project in which the resource belongs.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link string - The URI of the created resource.
- url string
- The base URL of the bucket, in the format
gs://<bucket-name>
.
- effective_
labels Mapping[str, str] - id str
- The provider-assigned unique ID for this managed resource.
- project_
number int - The project number of the project in which the resource belongs.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- self_
link str - The URI of the created resource.
- url str
- The base URL of the bucket, in the format
gs://<bucket-name>
.
- effective
Labels Map<String> - id String
- The provider-assigned unique ID for this managed resource.
- project
Number Number - The project number of the project in which the resource belongs.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - The URI of the created resource.
- url String
- The base URL of the bucket, in the format
gs://<bucket-name>
.
Look up Existing Bucket Resource
Get an existing Bucket resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: BucketState, opts?: CustomResourceOptions): Bucket
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
autoclass: Optional[BucketAutoclassArgs] = None,
cors: Optional[Sequence[BucketCorArgs]] = None,
custom_placement_config: Optional[BucketCustomPlacementConfigArgs] = None,
default_event_based_hold: Optional[bool] = None,
effective_labels: Optional[Mapping[str, str]] = None,
enable_object_retention: Optional[bool] = None,
encryption: Optional[BucketEncryptionArgs] = None,
force_destroy: Optional[bool] = None,
labels: Optional[Mapping[str, str]] = None,
lifecycle_rules: Optional[Sequence[BucketLifecycleRuleArgs]] = None,
location: Optional[str] = None,
logging: Optional[BucketLoggingArgs] = None,
name: Optional[str] = None,
project: Optional[str] = None,
project_number: Optional[int] = None,
public_access_prevention: Optional[str] = None,
pulumi_labels: Optional[Mapping[str, str]] = None,
requester_pays: Optional[bool] = None,
retention_policy: Optional[BucketRetentionPolicyArgs] = None,
rpo: Optional[str] = None,
self_link: Optional[str] = None,
soft_delete_policy: Optional[BucketSoftDeletePolicyArgs] = None,
storage_class: Optional[str] = None,
uniform_bucket_level_access: Optional[bool] = None,
url: Optional[str] = None,
versioning: Optional[BucketVersioningArgs] = None,
website: Optional[BucketWebsiteArgs] = None) -> Bucket
func GetBucket(ctx *Context, name string, id IDInput, state *BucketState, opts ...ResourceOption) (*Bucket, error)
public static Bucket Get(string name, Input<string> id, BucketState? state, CustomResourceOptions? opts = null)
public static Bucket get(String name, Output<String> id, BucketState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Autoclass
Bucket
Autoclass - The bucket's Autoclass configuration. Structure is documented below.
- Cors
List<Bucket
Cor> - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Custom
Placement BucketConfig Custom Placement Config - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- Default
Event boolBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- Effective
Labels Dictionary<string, string> - Enable
Object boolRetention - Enables object retention on a storage bucket.
- Encryption
Bucket
Encryption - The bucket's encryption configuration. Structure is documented below.
- Force
Destroy bool - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- Labels Dictionary<string, string>
- A map of key/value label pairs to assign to the bucket.
- Lifecycle
Rules List<BucketLifecycle Rule> - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Location string
- The GCS location.
- Logging
Bucket
Logging - The bucket's Access & Storage Logs configuration. Structure is documented below.
- Name string
- The name of the bucket.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Project
Number int - The project number of the project in which the resource belongs.
- Public
Access stringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Requester
Pays bool - Enables Requester Pays on a storage bucket.
- Retention
Policy BucketRetention Policy - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- Rpo string
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - Self
Link string - The URI of the created resource.
- Soft
Delete BucketPolicy Soft Delete Policy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- Storage
Class string - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - Uniform
Bucket boolLevel Access - Enables Uniform bucket-level access access to a bucket.
- Url string
- The base URL of the bucket, in the format
gs://<bucket-name>
. - Versioning
Bucket
Versioning - The bucket's Versioning configuration. Structure is documented below.
- Website
Bucket
Website - Configuration if the bucket acts as a website. Structure is documented below.
- Autoclass
Bucket
Autoclass Args - The bucket's Autoclass configuration. Structure is documented below.
- Cors
[]Bucket
Cor Args - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Custom
Placement BucketConfig Custom Placement Config Args - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- Default
Event boolBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- Effective
Labels map[string]string - Enable
Object boolRetention - Enables object retention on a storage bucket.
- Encryption
Bucket
Encryption Args - The bucket's encryption configuration. Structure is documented below.
- Force
Destroy bool - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- Labels map[string]string
- A map of key/value label pairs to assign to the bucket.
- Lifecycle
Rules []BucketLifecycle Rule Args - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- Location string
- The GCS location.
- Logging
Bucket
Logging Args - The bucket's Access & Storage Logs configuration. Structure is documented below.
- Name string
- The name of the bucket.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Project
Number int - The project number of the project in which the resource belongs.
- Public
Access stringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Requester
Pays bool - Enables Requester Pays on a storage bucket.
- Retention
Policy BucketRetention Policy Args - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- Rpo string
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - Self
Link string - The URI of the created resource.
- Soft
Delete BucketPolicy Soft Delete Policy Args - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- Storage
Class string - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - Uniform
Bucket boolLevel Access - Enables Uniform bucket-level access access to a bucket.
- Url string
- The base URL of the bucket, in the format
gs://<bucket-name>
. - Versioning
Bucket
Versioning Args - The bucket's Versioning configuration. Structure is documented below.
- Website
Bucket
Website Args - Configuration if the bucket acts as a website. Structure is documented below.
- autoclass
Bucket
Autoclass - The bucket's Autoclass configuration. Structure is documented below.
- cors
List<Bucket
Cor> - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom
Placement BucketConfig Custom Placement Config - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default
Event BooleanBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- effective
Labels Map<String,String> - enable
Object BooleanRetention - Enables object retention on a storage bucket.
- encryption
Bucket
Encryption - The bucket's encryption configuration. Structure is documented below.
- force
Destroy Boolean - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels Map<String,String>
- A map of key/value label pairs to assign to the bucket.
- lifecycle
Rules List<BucketLifecycle Rule> - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- location String
- The GCS location.
- logging
Bucket
Logging - The bucket's Access & Storage Logs configuration. Structure is documented below.
- name String
- The name of the bucket.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- project
Number Integer - The project number of the project in which the resource belongs.
- public
Access StringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- requester
Pays Boolean - Enables Requester Pays on a storage bucket.
- retention
Policy BucketRetention Policy - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo String
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - self
Link String - The URI of the created resource.
- soft
Delete BucketPolicy Soft Delete Policy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage
Class String - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform
Bucket BooleanLevel Access - Enables Uniform bucket-level access access to a bucket.
- url String
- The base URL of the bucket, in the format
gs://<bucket-name>
. - versioning
Bucket
Versioning - The bucket's Versioning configuration. Structure is documented below.
- website
Bucket
Website - Configuration if the bucket acts as a website. Structure is documented below.
- autoclass
Bucket
Autoclass - The bucket's Autoclass configuration. Structure is documented below.
- cors
Bucket
Cor[] - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom
Placement BucketConfig Custom Placement Config - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default
Event booleanBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- effective
Labels {[key: string]: string} - enable
Object booleanRetention - Enables object retention on a storage bucket.
- encryption
Bucket
Encryption - The bucket's encryption configuration. Structure is documented below.
- force
Destroy boolean - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels {[key: string]: string}
- A map of key/value label pairs to assign to the bucket.
- lifecycle
Rules BucketLifecycle Rule[] - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- location string
- The GCS location.
- logging
Bucket
Logging - The bucket's Access & Storage Logs configuration. Structure is documented below.
- name string
- The name of the bucket.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- project
Number number - The project number of the project in which the resource belongs.
- public
Access stringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- requester
Pays boolean - Enables Requester Pays on a storage bucket.
- retention
Policy BucketRetention Policy - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo string
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - self
Link string - The URI of the created resource.
- soft
Delete BucketPolicy Soft Delete Policy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage
Class string - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform
Bucket booleanLevel Access - Enables Uniform bucket-level access access to a bucket.
- url string
- The base URL of the bucket, in the format
gs://<bucket-name>
. - versioning
Bucket
Versioning - The bucket's Versioning configuration. Structure is documented below.
- website
Bucket
Website - Configuration if the bucket acts as a website. Structure is documented below.
- autoclass
Bucket
Autoclass Args - The bucket's Autoclass configuration. Structure is documented below.
- cors
Sequence[Bucket
Cor Args] - The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom_
placement_ Bucketconfig Custom Placement Config Args - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default_
event_ boolbased_ hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- effective_
labels Mapping[str, str] - enable_
object_ boolretention - Enables object retention on a storage bucket.
- encryption
Bucket
Encryption Args - The bucket's encryption configuration. Structure is documented below.
- force_
destroy bool - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels Mapping[str, str]
- A map of key/value label pairs to assign to the bucket.
- lifecycle_
rules Sequence[BucketLifecycle Rule Args] - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- location str
- The GCS location.
- logging
Bucket
Logging Args - The bucket's Access & Storage Logs configuration. Structure is documented below.
- name str
- The name of the bucket.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- project_
number int - The project number of the project in which the resource belongs.
- public_
access_ strprevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- requester_
pays bool - Enables Requester Pays on a storage bucket.
- retention_
policy BucketRetention Policy Args - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo str
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - self_
link str - The URI of the created resource.
- soft_
delete_ Bucketpolicy Soft Delete Policy Args - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage_
class str - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform_
bucket_ boollevel_ access - Enables Uniform bucket-level access access to a bucket.
- url str
- The base URL of the bucket, in the format
gs://<bucket-name>
. - versioning
Bucket
Versioning Args - The bucket's Versioning configuration. Structure is documented below.
- website
Bucket
Website Args - Configuration if the bucket acts as a website. Structure is documented below.
- autoclass Property Map
- The bucket's Autoclass configuration. Structure is documented below.
- cors List<Property Map>
- The bucket's Cross-Origin Resource Sharing (CORS) configuration. Multiple blocks of this type are permitted. Structure is documented below.
- custom
Placement Property MapConfig - The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. Structure is documented below.
- default
Event BooleanBased Hold - Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.
- effective
Labels Map<String> - enable
Object BooleanRetention - Enables object retention on a storage bucket.
- encryption Property Map
- The bucket's encryption configuration. Structure is documented below.
- force
Destroy Boolean - When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, the provider will fail that run.
- labels Map<String>
- A map of key/value label pairs to assign to the bucket.
- lifecycle
Rules List<Property Map> - The bucket's Lifecycle Rules configuration. Multiple blocks of this type are permitted. Structure is documented below.
- location String
- The GCS location.
- logging Property Map
- The bucket's Access & Storage Logs configuration. Structure is documented below.
- name String
- The name of the bucket.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- project
Number Number - The project number of the project in which the resource belongs.
- public
Access StringPrevention - Prevents public access to a bucket. Acceptable values are "inherited" or "enforced". If "inherited", the bucket uses public access prevention. only if the bucket is subject to the public access prevention organization policy constraint. Defaults to "inherited".
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- requester
Pays Boolean - Enables Requester Pays on a storage bucket.
- retention
Policy Property Map - Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
- rpo String
- The recovery point objective for cross-region replication of the bucket. Applicable only for dual and multi-region buckets.
"DEFAULT"
sets default replication."ASYNC_TURBO"
value enables turbo replication, valid for dual-region buckets only. See Turbo Replication for more information. If rpo is not specified at bucket creation, it defaults to"DEFAULT"
for dual and multi-region buckets. NOTE If used with single-region bucket, It will throw an error. - self
Link String - The URI of the created resource.
- soft
Delete Property MapPolicy - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy
- storage
Class String - The Storage Class of the new bucket. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
. - uniform
Bucket BooleanLevel Access - Enables Uniform bucket-level access access to a bucket.
- url String
- The base URL of the bucket, in the format
gs://<bucket-name>
. - versioning Property Map
- The bucket's Versioning configuration. Structure is documented below.
- website Property Map
- Configuration if the bucket acts as a website. Structure is documented below.
Supporting Types
BucketAutoclass, BucketAutoclassArgs
- Enabled bool
- While set to
true
, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern. - Terminal
Storage stringClass - The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include:
NEARLINE
,ARCHIVE
.
- Enabled bool
- While set to
true
, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern. - Terminal
Storage stringClass - The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include:
NEARLINE
,ARCHIVE
.
- enabled Boolean
- While set to
true
, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern. - terminal
Storage StringClass - The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include:
NEARLINE
,ARCHIVE
.
- enabled boolean
- While set to
true
, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern. - terminal
Storage stringClass - The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include:
NEARLINE
,ARCHIVE
.
- enabled bool
- While set to
true
, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern. - terminal_
storage_ strclass - The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include:
NEARLINE
,ARCHIVE
.
- enabled Boolean
- While set to
true
, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern. - terminal
Storage StringClass - The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include:
NEARLINE
,ARCHIVE
.
BucketCor, BucketCorArgs
- Max
Age intSeconds - The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
- Methods List<string>
- The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
- Origins List<string>
- The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
- Response
Headers List<string> - The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
- Max
Age intSeconds - The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
- Methods []string
- The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
- Origins []string
- The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
- Response
Headers []string - The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
- max
Age IntegerSeconds - The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
- methods List<String>
- The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
- origins List<String>
- The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
- response
Headers List<String> - The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
- max
Age numberSeconds - The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
- methods string[]
- The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
- origins string[]
- The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
- response
Headers string[] - The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
- max_
age_ intseconds - The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
- methods Sequence[str]
- The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
- origins Sequence[str]
- The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
- response_
headers Sequence[str] - The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
- max
Age NumberSeconds - The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
- methods List<String>
- The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".
- origins List<String>
- The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
- response
Headers List<String> - The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
BucketCustomPlacementConfig, BucketCustomPlacementConfigArgs
- Data
Locations List<string> - The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
- Data
Locations []string - The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
- data
Locations List<String> - The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
- data
Locations string[] - The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
- data_
locations Sequence[str] - The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
- data
Locations List<String> - The list of individual regions that comprise a dual-region bucket. See Cloud Storage bucket locations for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.
BucketEncryption, BucketEncryptionArgs
- Default
Kms stringKey Name The
id
of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the
gcp.storage.getProjectServiceAccount
data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.
- Default
Kms stringKey Name The
id
of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the
gcp.storage.getProjectServiceAccount
data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.
- default
Kms StringKey Name The
id
of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the
gcp.storage.getProjectServiceAccount
data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.
- default
Kms stringKey Name The
id
of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the
gcp.storage.getProjectServiceAccount
data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.
- default_
kms_ strkey_ name The
id
of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the
gcp.storage.getProjectServiceAccount
data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.
- default
Kms StringKey Name The
id
of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.As per the docs for customer-managed encryption keys, the IAM policy for the specified key must permit the automatic Google Cloud Storage service account for the bucket's project to use the specified key for encryption and decryption operations. Although the service account email address follows a well-known format, the service account is created on-demand and may not necessarily exist for your project until a relevant action has occurred which triggers its creation. You should use the
gcp.storage.getProjectServiceAccount
data source to obtain the email address for the service account when configuring IAM policy on the Cloud KMS key. This data source calls an API which creates the account if required, ensuring your provider applies cleanly and repeatedly irrespective of the state of the project. You should take care for race conditions when the same provider manages IAM policy on the Cloud KMS crypto key. See the data source page for more details.
BucketLifecycleRule, BucketLifecycleRuleArgs
- Action
Bucket
Lifecycle Rule Action - The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
- Condition
Bucket
Lifecycle Rule Condition - The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
- Action
Bucket
Lifecycle Rule Action - The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
- Condition
Bucket
Lifecycle Rule Condition - The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
- action
Bucket
Lifecycle Rule Action - The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
- condition
Bucket
Lifecycle Rule Condition - The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
- action
Bucket
Lifecycle Rule Action - The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
- condition
Bucket
Lifecycle Rule Condition - The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
- action
Bucket
Lifecycle Rule Action - The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
- condition
Bucket
Lifecycle Rule Condition - The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
- action Property Map
- The Lifecycle Rule's action configuration. A single block of this type is supported. Structure is documented below.
- condition Property Map
- The Lifecycle Rule's condition configuration. A single block of this type is supported. Structure is documented below.
BucketLifecycleRuleAction, BucketLifecycleRuleActionArgs
- Type string
- The type of the action of this Lifecycle Rule. Supported values include:
Delete
,SetStorageClass
andAbortIncompleteMultipartUpload
. - Storage
Class string - The target Storage Class of objects affected by this Lifecycle Rule. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
.
- Type string
- The type of the action of this Lifecycle Rule. Supported values include:
Delete
,SetStorageClass
andAbortIncompleteMultipartUpload
. - Storage
Class string - The target Storage Class of objects affected by this Lifecycle Rule. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
.
- type String
- The type of the action of this Lifecycle Rule. Supported values include:
Delete
,SetStorageClass
andAbortIncompleteMultipartUpload
. - storage
Class String - The target Storage Class of objects affected by this Lifecycle Rule. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
.
- type string
- The type of the action of this Lifecycle Rule. Supported values include:
Delete
,SetStorageClass
andAbortIncompleteMultipartUpload
. - storage
Class string - The target Storage Class of objects affected by this Lifecycle Rule. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
.
- type str
- The type of the action of this Lifecycle Rule. Supported values include:
Delete
,SetStorageClass
andAbortIncompleteMultipartUpload
. - storage_
class str - The target Storage Class of objects affected by this Lifecycle Rule. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
.
- type String
- The type of the action of this Lifecycle Rule. Supported values include:
Delete
,SetStorageClass
andAbortIncompleteMultipartUpload
. - storage
Class String - The target Storage Class of objects affected by this Lifecycle Rule. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
.
BucketLifecycleRuleCondition, BucketLifecycleRuleConditionArgs
- Age int
- Minimum age of an object in days to satisfy this condition. Note To set
0
value ofage
,send_age_if_zero
should be settrue
otherwise0
value ofage
field will be ignored. - Created
Before string - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
- Custom
Time stringBefore - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
- Days
Since intCustom Time - Number of days elapsed since the user-specified timestamp set on an object.
- Days
Since intNoncurrent Time - Number of days elapsed since the noncurrent timestamp of an object. This condition is relevant only for versioned objects.
- Matches
Prefixes List<string> - One or more matching name prefixes to satisfy this condition.
- Matches
Storage List<string>Classes - Storage Class of objects to satisfy this condition. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
,DURABLE_REDUCED_AVAILABILITY
. - Matches
Suffixes List<string> - One or more matching name suffixes to satisfy this condition.
- Noncurrent
Time stringBefore - Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.
- Num
Newer intVersions - Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
- Send
Age boolIf Zero - While set true,
age
value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to theage
field. It can be used alone or together withage
attribute. NOTEage
attibute with0
value will be ommitted from the API request ifsend_age_if_zero
field is havingfalse
value. - Send
Days boolSince Custom Time If Zero - While set true,
days_since_custom_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_custom_time
field. It can be used alone or together withdays_since_custom_time
. - Send
Days boolSince Noncurrent Time If Zero - While set true,
days_since_noncurrent_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_noncurrent_time
field. It can be used alone or together withdays_since_noncurrent_time
. - Send
Num boolNewer Versions If Zero - While set true,
num_newer_versions
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thenum_newer_versions
field. It can be used alone or together withnum_newer_versions
. - With
State string - Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include:
"LIVE"
,"ARCHIVED"
,"ANY"
.
- Age int
- Minimum age of an object in days to satisfy this condition. Note To set
0
value ofage
,send_age_if_zero
should be settrue
otherwise0
value ofage
field will be ignored. - Created
Before string - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
- Custom
Time stringBefore - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
- Days
Since intCustom Time - Number of days elapsed since the user-specified timestamp set on an object.
- Days
Since intNoncurrent Time - Number of days elapsed since the noncurrent timestamp of an object. This condition is relevant only for versioned objects.
- Matches
Prefixes []string - One or more matching name prefixes to satisfy this condition.
- Matches
Storage []stringClasses - Storage Class of objects to satisfy this condition. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
,DURABLE_REDUCED_AVAILABILITY
. - Matches
Suffixes []string - One or more matching name suffixes to satisfy this condition.
- Noncurrent
Time stringBefore - Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.
- Num
Newer intVersions - Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
- Send
Age boolIf Zero - While set true,
age
value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to theage
field. It can be used alone or together withage
attribute. NOTEage
attibute with0
value will be ommitted from the API request ifsend_age_if_zero
field is havingfalse
value. - Send
Days boolSince Custom Time If Zero - While set true,
days_since_custom_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_custom_time
field. It can be used alone or together withdays_since_custom_time
. - Send
Days boolSince Noncurrent Time If Zero - While set true,
days_since_noncurrent_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_noncurrent_time
field. It can be used alone or together withdays_since_noncurrent_time
. - Send
Num boolNewer Versions If Zero - While set true,
num_newer_versions
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thenum_newer_versions
field. It can be used alone or together withnum_newer_versions
. - With
State string - Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include:
"LIVE"
,"ARCHIVED"
,"ANY"
.
- age Integer
- Minimum age of an object in days to satisfy this condition. Note To set
0
value ofage
,send_age_if_zero
should be settrue
otherwise0
value ofage
field will be ignored. - created
Before String - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
- custom
Time StringBefore - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
- days
Since IntegerCustom Time - Number of days elapsed since the user-specified timestamp set on an object.
- days
Since IntegerNoncurrent Time - Number of days elapsed since the noncurrent timestamp of an object. This condition is relevant only for versioned objects.
- matches
Prefixes List<String> - One or more matching name prefixes to satisfy this condition.
- matches
Storage List<String>Classes - Storage Class of objects to satisfy this condition. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
,DURABLE_REDUCED_AVAILABILITY
. - matches
Suffixes List<String> - One or more matching name suffixes to satisfy this condition.
- noncurrent
Time StringBefore - Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.
- num
Newer IntegerVersions - Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
- send
Age BooleanIf Zero - While set true,
age
value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to theage
field. It can be used alone or together withage
attribute. NOTEage
attibute with0
value will be ommitted from the API request ifsend_age_if_zero
field is havingfalse
value. - send
Days BooleanSince Custom Time If Zero - While set true,
days_since_custom_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_custom_time
field. It can be used alone or together withdays_since_custom_time
. - send
Days BooleanSince Noncurrent Time If Zero - While set true,
days_since_noncurrent_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_noncurrent_time
field. It can be used alone or together withdays_since_noncurrent_time
. - send
Num BooleanNewer Versions If Zero - While set true,
num_newer_versions
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thenum_newer_versions
field. It can be used alone or together withnum_newer_versions
. - with
State String - Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include:
"LIVE"
,"ARCHIVED"
,"ANY"
.
- age number
- Minimum age of an object in days to satisfy this condition. Note To set
0
value ofage
,send_age_if_zero
should be settrue
otherwise0
value ofage
field will be ignored. - created
Before string - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
- custom
Time stringBefore - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
- days
Since numberCustom Time - Number of days elapsed since the user-specified timestamp set on an object.
- days
Since numberNoncurrent Time - Number of days elapsed since the noncurrent timestamp of an object. This condition is relevant only for versioned objects.
- matches
Prefixes string[] - One or more matching name prefixes to satisfy this condition.
- matches
Storage string[]Classes - Storage Class of objects to satisfy this condition. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
,DURABLE_REDUCED_AVAILABILITY
. - matches
Suffixes string[] - One or more matching name suffixes to satisfy this condition.
- noncurrent
Time stringBefore - Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.
- num
Newer numberVersions - Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
- send
Age booleanIf Zero - While set true,
age
value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to theage
field. It can be used alone or together withage
attribute. NOTEage
attibute with0
value will be ommitted from the API request ifsend_age_if_zero
field is havingfalse
value. - send
Days booleanSince Custom Time If Zero - While set true,
days_since_custom_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_custom_time
field. It can be used alone or together withdays_since_custom_time
. - send
Days booleanSince Noncurrent Time If Zero - While set true,
days_since_noncurrent_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_noncurrent_time
field. It can be used alone or together withdays_since_noncurrent_time
. - send
Num booleanNewer Versions If Zero - While set true,
num_newer_versions
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thenum_newer_versions
field. It can be used alone or together withnum_newer_versions
. - with
State string - Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include:
"LIVE"
,"ARCHIVED"
,"ANY"
.
- age int
- Minimum age of an object in days to satisfy this condition. Note To set
0
value ofage
,send_age_if_zero
should be settrue
otherwise0
value ofage
field will be ignored. - created_
before str - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
- custom_
time_ strbefore - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
- days_
since_ intcustom_ time - Number of days elapsed since the user-specified timestamp set on an object.
- days_
since_ intnoncurrent_ time - Number of days elapsed since the noncurrent timestamp of an object. This condition is relevant only for versioned objects.
- matches_
prefixes Sequence[str] - One or more matching name prefixes to satisfy this condition.
- matches_
storage_ Sequence[str]classes - Storage Class of objects to satisfy this condition. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
,DURABLE_REDUCED_AVAILABILITY
. - matches_
suffixes Sequence[str] - One or more matching name suffixes to satisfy this condition.
- noncurrent_
time_ strbefore - Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.
- num_
newer_ intversions - Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
- send_
age_ boolif_ zero - While set true,
age
value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to theage
field. It can be used alone or together withage
attribute. NOTEage
attibute with0
value will be ommitted from the API request ifsend_age_if_zero
field is havingfalse
value. - send_
days_ boolsince_ custom_ time_ if_ zero - While set true,
days_since_custom_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_custom_time
field. It can be used alone or together withdays_since_custom_time
. - send_
days_ boolsince_ noncurrent_ time_ if_ zero - While set true,
days_since_noncurrent_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_noncurrent_time
field. It can be used alone or together withdays_since_noncurrent_time
. - send_
num_ boolnewer_ versions_ if_ zero - While set true,
num_newer_versions
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thenum_newer_versions
field. It can be used alone or together withnum_newer_versions
. - with_
state str - Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include:
"LIVE"
,"ARCHIVED"
,"ANY"
.
- age Number
- Minimum age of an object in days to satisfy this condition. Note To set
0
value ofage
,send_age_if_zero
should be settrue
otherwise0
value ofage
field will be ignored. - created
Before String - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC.
- custom
Time StringBefore - A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.
- days
Since NumberCustom Time - Number of days elapsed since the user-specified timestamp set on an object.
- days
Since NumberNoncurrent Time - Number of days elapsed since the noncurrent timestamp of an object. This condition is relevant only for versioned objects.
- matches
Prefixes List<String> - One or more matching name prefixes to satisfy this condition.
- matches
Storage List<String>Classes - Storage Class of objects to satisfy this condition. Supported values include:
STANDARD
,MULTI_REGIONAL
,REGIONAL
,NEARLINE
,COLDLINE
,ARCHIVE
,DURABLE_REDUCED_AVAILABILITY
. - matches
Suffixes List<String> - One or more matching name suffixes to satisfy this condition.
- noncurrent
Time StringBefore - Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.
- num
Newer NumberVersions - Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.
- send
Age BooleanIf Zero - While set true,
age
value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to theage
field. It can be used alone or together withage
attribute. NOTEage
attibute with0
value will be ommitted from the API request ifsend_age_if_zero
field is havingfalse
value. - send
Days BooleanSince Custom Time If Zero - While set true,
days_since_custom_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_custom_time
field. It can be used alone or together withdays_since_custom_time
. - send
Days BooleanSince Noncurrent Time If Zero - While set true,
days_since_noncurrent_time
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thedays_since_noncurrent_time
field. It can be used alone or together withdays_since_noncurrent_time
. - send
Num BooleanNewer Versions If Zero - While set true,
num_newer_versions
value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to thenum_newer_versions
field. It can be used alone or together withnum_newer_versions
. - with
State String - Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include:
"LIVE"
,"ARCHIVED"
,"ANY"
.
BucketLogging, BucketLoggingArgs
- Log
Bucket string - The bucket that will receive log objects.
- Log
Object stringPrefix - The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
- Log
Bucket string - The bucket that will receive log objects.
- Log
Object stringPrefix - The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
- log
Bucket String - The bucket that will receive log objects.
- log
Object StringPrefix - The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
- log
Bucket string - The bucket that will receive log objects.
- log
Object stringPrefix - The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
- log_
bucket str - The bucket that will receive log objects.
- log_
object_ strprefix - The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
- log
Bucket String - The bucket that will receive log objects.
- log
Object StringPrefix - The object prefix for log objects. If it's not provided, by default GCS sets this to this bucket's name.
BucketRetentionPolicy, BucketRetentionPolicyArgs
- Retention
Period int - The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
- Is
Locked bool - If set to
true
, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
- Retention
Period int - The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
- Is
Locked bool - If set to
true
, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
- retention
Period Integer - The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
- is
Locked Boolean - If set to
true
, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
- retention
Period number - The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
- is
Locked boolean - If set to
true
, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
- retention_
period int - The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
- is_
locked bool - If set to
true
, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
- retention
Period Number - The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
- is
Locked Boolean - If set to
true
, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.
BucketSoftDeletePolicy, BucketSoftDeletePolicyArgs
- Effective
Time string - Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
- Retention
Duration intSeconds - The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
- Effective
Time string - Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
- Retention
Duration intSeconds - The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
- effective
Time String - Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
- retention
Duration IntegerSeconds - The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
- effective
Time string - Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
- retention
Duration numberSeconds - The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
- effective_
time str - Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
- retention_
duration_ intseconds - The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
- effective
Time String - Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.
- retention
Duration NumberSeconds - The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. The value must be in between 604800(7 days) and 7776000(90 days). Note: To disable the soft delete policy on a bucket, This field must be set to 0.
BucketVersioning, BucketVersioningArgs
- Enabled bool
- While set to
true
, versioning is fully enabled for this bucket.
- Enabled bool
- While set to
true
, versioning is fully enabled for this bucket.
- enabled Boolean
- While set to
true
, versioning is fully enabled for this bucket.
- enabled boolean
- While set to
true
, versioning is fully enabled for this bucket.
- enabled bool
- While set to
true
, versioning is fully enabled for this bucket.
- enabled Boolean
- While set to
true
, versioning is fully enabled for this bucket.
BucketWebsite, BucketWebsiteArgs
- Main
Page stringSuffix - Behaves as the bucket's directory index where missing objects are treated as potential directories.
- Not
Found stringPage - The custom object to return when a requested resource is not found.
- Main
Page stringSuffix - Behaves as the bucket's directory index where missing objects are treated as potential directories.
- Not
Found stringPage - The custom object to return when a requested resource is not found.
- main
Page StringSuffix - Behaves as the bucket's directory index where missing objects are treated as potential directories.
- not
Found StringPage - The custom object to return when a requested resource is not found.
- main
Page stringSuffix - Behaves as the bucket's directory index where missing objects are treated as potential directories.
- not
Found stringPage - The custom object to return when a requested resource is not found.
- main_
page_ strsuffix - Behaves as the bucket's directory index where missing objects are treated as potential directories.
- not_
found_ strpage - The custom object to return when a requested resource is not found.
- main
Page StringSuffix - Behaves as the bucket's directory index where missing objects are treated as potential directories.
- not
Found StringPage - The custom object to return when a requested resource is not found.
Import
Storage buckets can be imported using the name
or project/name
. If the project is not
passed to the import command it will be inferred from the provider block or environment variables.
If it cannot be inferred it will be queried from the Compute API (this will fail if the API is
not enabled).
{{project_id}}/{{bucket}}
{{bucket}}
When using the pulumi import
command, Storage buckets can be imported using one of the formats above. For example:
$ pulumi import gcp:storage/bucket:Bucket default {{bucket}}
$ pulumi import gcp:storage/bucket:Bucket default {{project_id}}/{{bucket}}
false
in state. If you’ve set it to true
in config, run pulumi up
to
update the value set in state. If you delete this resource before updating the
value, objects in the bucket will not be destroyed.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.