1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. SpacesBucket
DigitalOcean v4.42.0 published on Thursday, Apr 17, 2025 by Pulumi

digitalocean.SpacesBucket

Explore with Pulumi AI

Provides a bucket resource for Spaces, DigitalOcean’s object storage product.

The Spaces API was designed to be interoperable with Amazon’s AWS S3 API. This allows users to interact with the service while using the tools they already know. Spaces mirrors S3’s authentication framework and requests to Spaces require a key pair similar to Amazon’s Access ID and Secret Key.

The authentication requirement can be met by either setting the SPACES_ACCESS_KEY_ID and SPACES_SECRET_ACCESS_KEY environment variables or the provider’s spaces_access_id and spaces_secret_key arguments to the access ID and secret you generate via the DigitalOcean control panel. For example:

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

const static_assets = new digitalocean.SpacesBucket("static-assets", {});
Copy
import pulumi
import pulumi_digitalocean as digitalocean

static_assets = digitalocean.SpacesBucket("static-assets")
Copy
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := digitalocean.NewSpacesBucket(ctx, "static-assets", nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var static_assets = new DigitalOcean.SpacesBucket("static-assets");

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.SpacesBucket;
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_assets = new SpacesBucket("static-assets");

    }
}
Copy
resources:
  static-assets:
    type: digitalocean:SpacesBucket
Copy

For more information, See An Introduction to DigitalOcean Spaces

Example Usage

Create a New Bucket

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

const foobar = new digitalocean.SpacesBucket("foobar", {
    name: "foobar",
    region: digitalocean.Region.NYC3,
});
Copy
import pulumi
import pulumi_digitalocean as digitalocean

foobar = digitalocean.SpacesBucket("foobar",
    name="foobar",
    region=digitalocean.Region.NYC3)
Copy
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := digitalocean.NewSpacesBucket(ctx, "foobar", &digitalocean.SpacesBucketArgs{
			Name:   pulumi.String("foobar"),
			Region: pulumi.String(digitalocean.RegionNYC3),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var foobar = new DigitalOcean.SpacesBucket("foobar", new()
    {
        Name = "foobar",
        Region = DigitalOcean.Region.NYC3,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.SpacesBucket;
import com.pulumi.digitalocean.SpacesBucketArgs;
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 foobar = new SpacesBucket("foobar", SpacesBucketArgs.builder()
            .name("foobar")
            .region("nyc3")
            .build());

    }
}
Copy
resources:
  foobar:
    type: digitalocean:SpacesBucket
    properties:
      name: foobar
      region: nyc3
Copy

Create a New Bucket With CORS Rules

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

const foobar = new digitalocean.SpacesBucket("foobar", {
    name: "foobar",
    region: digitalocean.Region.NYC3,
    corsRules: [
        {
            allowedHeaders: ["*"],
            allowedMethods: ["GET"],
            allowedOrigins: ["*"],
            maxAgeSeconds: 3000,
        },
        {
            allowedHeaders: ["*"],
            allowedMethods: [
                "PUT",
                "POST",
                "DELETE",
            ],
            allowedOrigins: ["https://www.example.com"],
            maxAgeSeconds: 3000,
        },
    ],
});
Copy
import pulumi
import pulumi_digitalocean as digitalocean

foobar = digitalocean.SpacesBucket("foobar",
    name="foobar",
    region=digitalocean.Region.NYC3,
    cors_rules=[
        {
            "allowed_headers": ["*"],
            "allowed_methods": ["GET"],
            "allowed_origins": ["*"],
            "max_age_seconds": 3000,
        },
        {
            "allowed_headers": ["*"],
            "allowed_methods": [
                "PUT",
                "POST",
                "DELETE",
            ],
            "allowed_origins": ["https://www.example.com"],
            "max_age_seconds": 3000,
        },
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := digitalocean.NewSpacesBucket(ctx, "foobar", &digitalocean.SpacesBucketArgs{
			Name:   pulumi.String("foobar"),
			Region: pulumi.String(digitalocean.RegionNYC3),
			CorsRules: digitalocean.SpacesBucketCorsRuleArray{
				&digitalocean.SpacesBucketCorsRuleArgs{
					AllowedHeaders: pulumi.StringArray{
						pulumi.String("*"),
					},
					AllowedMethods: pulumi.StringArray{
						pulumi.String("GET"),
					},
					AllowedOrigins: pulumi.StringArray{
						pulumi.String("*"),
					},
					MaxAgeSeconds: pulumi.Int(3000),
				},
				&digitalocean.SpacesBucketCorsRuleArgs{
					AllowedHeaders: pulumi.StringArray{
						pulumi.String("*"),
					},
					AllowedMethods: pulumi.StringArray{
						pulumi.String("PUT"),
						pulumi.String("POST"),
						pulumi.String("DELETE"),
					},
					AllowedOrigins: pulumi.StringArray{
						pulumi.String("https://www.example.com"),
					},
					MaxAgeSeconds: pulumi.Int(3000),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var foobar = new DigitalOcean.SpacesBucket("foobar", new()
    {
        Name = "foobar",
        Region = DigitalOcean.Region.NYC3,
        CorsRules = new[]
        {
            new DigitalOcean.Inputs.SpacesBucketCorsRuleArgs
            {
                AllowedHeaders = new[]
                {
                    "*",
                },
                AllowedMethods = new[]
                {
                    "GET",
                },
                AllowedOrigins = new[]
                {
                    "*",
                },
                MaxAgeSeconds = 3000,
            },
            new DigitalOcean.Inputs.SpacesBucketCorsRuleArgs
            {
                AllowedHeaders = new[]
                {
                    "*",
                },
                AllowedMethods = new[]
                {
                    "PUT",
                    "POST",
                    "DELETE",
                },
                AllowedOrigins = new[]
                {
                    "https://www.example.com",
                },
                MaxAgeSeconds = 3000,
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.SpacesBucket;
import com.pulumi.digitalocean.SpacesBucketArgs;
import com.pulumi.digitalocean.inputs.SpacesBucketCorsRuleArgs;
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 foobar = new SpacesBucket("foobar", SpacesBucketArgs.builder()
            .name("foobar")
            .region("nyc3")
            .corsRules(            
                SpacesBucketCorsRuleArgs.builder()
                    .allowedHeaders("*")
                    .allowedMethods("GET")
                    .allowedOrigins("*")
                    .maxAgeSeconds(3000)
                    .build(),
                SpacesBucketCorsRuleArgs.builder()
                    .allowedHeaders("*")
                    .allowedMethods(                    
                        "PUT",
                        "POST",
                        "DELETE")
                    .allowedOrigins("https://www.example.com")
                    .maxAgeSeconds(3000)
                    .build())
            .build());

    }
}
Copy
resources:
  foobar:
    type: digitalocean:SpacesBucket
    properties:
      name: foobar
      region: nyc3
      corsRules:
        - allowedHeaders:
            - '*'
          allowedMethods:
            - GET
          allowedOrigins:
            - '*'
          maxAgeSeconds: 3000
        - allowedHeaders:
            - '*'
          allowedMethods:
            - PUT
            - POST
            - DELETE
          allowedOrigins:
            - https://www.example.com
          maxAgeSeconds: 3000
Copy

Create SpacesBucket Resource

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

Constructor syntax

new SpacesBucket(name: string, args?: SpacesBucketArgs, opts?: CustomResourceOptions);
@overload
def SpacesBucket(resource_name: str,
                 args: Optional[SpacesBucketArgs] = None,
                 opts: Optional[ResourceOptions] = None)

@overload
def SpacesBucket(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 acl: Optional[str] = None,
                 cors_rules: Optional[Sequence[SpacesBucketCorsRuleArgs]] = None,
                 force_destroy: Optional[bool] = None,
                 lifecycle_rules: Optional[Sequence[SpacesBucketLifecycleRuleArgs]] = None,
                 name: Optional[str] = None,
                 region: Optional[Union[str, Region]] = None,
                 versioning: Optional[SpacesBucketVersioningArgs] = None)
func NewSpacesBucket(ctx *Context, name string, args *SpacesBucketArgs, opts ...ResourceOption) (*SpacesBucket, error)
public SpacesBucket(string name, SpacesBucketArgs? args = null, CustomResourceOptions? opts = null)
public SpacesBucket(String name, SpacesBucketArgs args)
public SpacesBucket(String name, SpacesBucketArgs args, CustomResourceOptions options)
type: digitalocean:SpacesBucket
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args SpacesBucketArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args SpacesBucketArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args SpacesBucketArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args SpacesBucketArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SpacesBucketArgs
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 spacesBucketResource = new DigitalOcean.SpacesBucket("spacesBucketResource", new()
{
    Acl = "string",
    ForceDestroy = false,
    LifecycleRules = new[]
    {
        new DigitalOcean.Inputs.SpacesBucketLifecycleRuleArgs
        {
            Enabled = false,
            AbortIncompleteMultipartUploadDays = 0,
            Expiration = new DigitalOcean.Inputs.SpacesBucketLifecycleRuleExpirationArgs
            {
                Date = "string",
                Days = 0,
                ExpiredObjectDeleteMarker = false,
            },
            Id = "string",
            NoncurrentVersionExpiration = new DigitalOcean.Inputs.SpacesBucketLifecycleRuleNoncurrentVersionExpirationArgs
            {
                Days = 0,
            },
            Prefix = "string",
        },
    },
    Name = "string",
    Region = "string",
    Versioning = new DigitalOcean.Inputs.SpacesBucketVersioningArgs
    {
        Enabled = false,
    },
});
Copy
example, err := digitalocean.NewSpacesBucket(ctx, "spacesBucketResource", &digitalocean.SpacesBucketArgs{
	Acl:          pulumi.String("string"),
	ForceDestroy: pulumi.Bool(false),
	LifecycleRules: digitalocean.SpacesBucketLifecycleRuleArray{
		&digitalocean.SpacesBucketLifecycleRuleArgs{
			Enabled:                            pulumi.Bool(false),
			AbortIncompleteMultipartUploadDays: pulumi.Int(0),
			Expiration: &digitalocean.SpacesBucketLifecycleRuleExpirationArgs{
				Date:                      pulumi.String("string"),
				Days:                      pulumi.Int(0),
				ExpiredObjectDeleteMarker: pulumi.Bool(false),
			},
			Id: pulumi.String("string"),
			NoncurrentVersionExpiration: &digitalocean.SpacesBucketLifecycleRuleNoncurrentVersionExpirationArgs{
				Days: pulumi.Int(0),
			},
			Prefix: pulumi.String("string"),
		},
	},
	Name:   pulumi.String("string"),
	Region: pulumi.String("string"),
	Versioning: &digitalocean.SpacesBucketVersioningArgs{
		Enabled: pulumi.Bool(false),
	},
})
Copy
var spacesBucketResource = new SpacesBucket("spacesBucketResource", SpacesBucketArgs.builder()
    .acl("string")
    .forceDestroy(false)
    .lifecycleRules(SpacesBucketLifecycleRuleArgs.builder()
        .enabled(false)
        .abortIncompleteMultipartUploadDays(0)
        .expiration(SpacesBucketLifecycleRuleExpirationArgs.builder()
            .date("string")
            .days(0)
            .expiredObjectDeleteMarker(false)
            .build())
        .id("string")
        .noncurrentVersionExpiration(SpacesBucketLifecycleRuleNoncurrentVersionExpirationArgs.builder()
            .days(0)
            .build())
        .prefix("string")
        .build())
    .name("string")
    .region("string")
    .versioning(SpacesBucketVersioningArgs.builder()
        .enabled(false)
        .build())
    .build());
Copy
spaces_bucket_resource = digitalocean.SpacesBucket("spacesBucketResource",
    acl="string",
    force_destroy=False,
    lifecycle_rules=[{
        "enabled": False,
        "abort_incomplete_multipart_upload_days": 0,
        "expiration": {
            "date": "string",
            "days": 0,
            "expired_object_delete_marker": False,
        },
        "id": "string",
        "noncurrent_version_expiration": {
            "days": 0,
        },
        "prefix": "string",
    }],
    name="string",
    region="string",
    versioning={
        "enabled": False,
    })
Copy
const spacesBucketResource = new digitalocean.SpacesBucket("spacesBucketResource", {
    acl: "string",
    forceDestroy: false,
    lifecycleRules: [{
        enabled: false,
        abortIncompleteMultipartUploadDays: 0,
        expiration: {
            date: "string",
            days: 0,
            expiredObjectDeleteMarker: false,
        },
        id: "string",
        noncurrentVersionExpiration: {
            days: 0,
        },
        prefix: "string",
    }],
    name: "string",
    region: "string",
    versioning: {
        enabled: false,
    },
});
Copy
type: digitalocean:SpacesBucket
properties:
    acl: string
    forceDestroy: false
    lifecycleRules:
        - abortIncompleteMultipartUploadDays: 0
          enabled: false
          expiration:
            date: string
            days: 0
            expiredObjectDeleteMarker: false
          id: string
          noncurrentVersionExpiration:
            days: 0
          prefix: string
    name: string
    region: string
    versioning:
        enabled: false
Copy

SpacesBucket Resource Properties

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

Inputs

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

The SpacesBucket resource accepts the following input properties:

Acl string
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
CorsRules List<Pulumi.DigitalOcean.Inputs.SpacesBucketCorsRule>
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

ForceDestroy bool
Unless true, the bucket will only be destroyed if empty (Defaults to false)
LifecycleRules List<Pulumi.DigitalOcean.Inputs.SpacesBucketLifecycleRule>
A configuration of object lifecycle management (documented below).
Name string
The name of the bucket
Region Changes to this property will trigger replacement. string | Pulumi.DigitalOcean.Region
The region where the bucket resides (Defaults to nyc3)
Versioning Pulumi.DigitalOcean.Inputs.SpacesBucketVersioning
A state of versioning (documented below)
Acl string
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
CorsRules []SpacesBucketCorsRuleArgs
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

ForceDestroy bool
Unless true, the bucket will only be destroyed if empty (Defaults to false)
LifecycleRules []SpacesBucketLifecycleRuleArgs
A configuration of object lifecycle management (documented below).
Name string
The name of the bucket
Region Changes to this property will trigger replacement. string | Region
The region where the bucket resides (Defaults to nyc3)
Versioning SpacesBucketVersioningArgs
A state of versioning (documented below)
acl String
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
corsRules List<SpacesBucketCorsRule>
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

forceDestroy Boolean
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycleRules List<SpacesBucketLifecycleRule>
A configuration of object lifecycle management (documented below).
name String
The name of the bucket
region Changes to this property will trigger replacement. String | Region
The region where the bucket resides (Defaults to nyc3)
versioning SpacesBucketVersioning
A state of versioning (documented below)
acl string
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
corsRules SpacesBucketCorsRule[]
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

forceDestroy boolean
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycleRules SpacesBucketLifecycleRule[]
A configuration of object lifecycle management (documented below).
name string
The name of the bucket
region Changes to this property will trigger replacement. string | Region
The region where the bucket resides (Defaults to nyc3)
versioning SpacesBucketVersioning
A state of versioning (documented below)
acl str
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
cors_rules Sequence[SpacesBucketCorsRuleArgs]
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

force_destroy bool
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycle_rules Sequence[SpacesBucketLifecycleRuleArgs]
A configuration of object lifecycle management (documented below).
name str
The name of the bucket
region Changes to this property will trigger replacement. str | Region
The region where the bucket resides (Defaults to nyc3)
versioning SpacesBucketVersioningArgs
A state of versioning (documented below)
acl String
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
corsRules List<Property Map>
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

forceDestroy Boolean
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycleRules List<Property Map>
A configuration of object lifecycle management (documented below).
name String
The name of the bucket
region Changes to this property will trigger replacement. String | "nyc1" | "nyc2" | "nyc3" | "sgp1" | "lon1" | "ams2" | "ams3" | "fra1" | "tor1" | "sfo1" | "sfo2" | "sfo3" | "blr1" | "syd1"
The region where the bucket resides (Defaults to nyc3)
versioning Property Map
A state of versioning (documented below)

Outputs

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

BucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
BucketUrn string
The uniform resource name for the bucket
Endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
Id string
The provider-assigned unique ID for this managed resource.
BucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
BucketUrn string
The uniform resource name for the bucket
Endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
Id string
The provider-assigned unique ID for this managed resource.
bucketDomainName String
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucketUrn String
The uniform resource name for the bucket
endpoint String
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id String
The provider-assigned unique ID for this managed resource.
bucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucketUrn string
The uniform resource name for the bucket
endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id string
The provider-assigned unique ID for this managed resource.
bucket_domain_name str
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucket_urn str
The uniform resource name for the bucket
endpoint str
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id str
The provider-assigned unique ID for this managed resource.
bucketDomainName String
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucketUrn String
The uniform resource name for the bucket
endpoint String
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SpacesBucket Resource

Get an existing SpacesBucket 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?: SpacesBucketState, opts?: CustomResourceOptions): SpacesBucket
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        acl: Optional[str] = None,
        bucket_domain_name: Optional[str] = None,
        bucket_urn: Optional[str] = None,
        cors_rules: Optional[Sequence[SpacesBucketCorsRuleArgs]] = None,
        endpoint: Optional[str] = None,
        force_destroy: Optional[bool] = None,
        lifecycle_rules: Optional[Sequence[SpacesBucketLifecycleRuleArgs]] = None,
        name: Optional[str] = None,
        region: Optional[Union[str, Region]] = None,
        versioning: Optional[SpacesBucketVersioningArgs] = None) -> SpacesBucket
func GetSpacesBucket(ctx *Context, name string, id IDInput, state *SpacesBucketState, opts ...ResourceOption) (*SpacesBucket, error)
public static SpacesBucket Get(string name, Input<string> id, SpacesBucketState? state, CustomResourceOptions? opts = null)
public static SpacesBucket get(String name, Output<String> id, SpacesBucketState state, CustomResourceOptions options)
resources:  _:    type: digitalocean:SpacesBucket    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Acl string
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
BucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
BucketUrn string
The uniform resource name for the bucket
CorsRules List<Pulumi.DigitalOcean.Inputs.SpacesBucketCorsRule>
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

Endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
ForceDestroy bool
Unless true, the bucket will only be destroyed if empty (Defaults to false)
LifecycleRules List<Pulumi.DigitalOcean.Inputs.SpacesBucketLifecycleRule>
A configuration of object lifecycle management (documented below).
Name string
The name of the bucket
Region Changes to this property will trigger replacement. string | Pulumi.DigitalOcean.Region
The region where the bucket resides (Defaults to nyc3)
Versioning Pulumi.DigitalOcean.Inputs.SpacesBucketVersioning
A state of versioning (documented below)
Acl string
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
BucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
BucketUrn string
The uniform resource name for the bucket
CorsRules []SpacesBucketCorsRuleArgs
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

Endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
ForceDestroy bool
Unless true, the bucket will only be destroyed if empty (Defaults to false)
LifecycleRules []SpacesBucketLifecycleRuleArgs
A configuration of object lifecycle management (documented below).
Name string
The name of the bucket
Region Changes to this property will trigger replacement. string | Region
The region where the bucket resides (Defaults to nyc3)
Versioning SpacesBucketVersioningArgs
A state of versioning (documented below)
acl String
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
bucketDomainName String
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucketUrn String
The uniform resource name for the bucket
corsRules List<SpacesBucketCorsRule>
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

endpoint String
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
forceDestroy Boolean
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycleRules List<SpacesBucketLifecycleRule>
A configuration of object lifecycle management (documented below).
name String
The name of the bucket
region Changes to this property will trigger replacement. String | Region
The region where the bucket resides (Defaults to nyc3)
versioning SpacesBucketVersioning
A state of versioning (documented below)
acl string
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
bucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucketUrn string
The uniform resource name for the bucket
corsRules SpacesBucketCorsRule[]
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
forceDestroy boolean
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycleRules SpacesBucketLifecycleRule[]
A configuration of object lifecycle management (documented below).
name string
The name of the bucket
region Changes to this property will trigger replacement. string | Region
The region where the bucket resides (Defaults to nyc3)
versioning SpacesBucketVersioning
A state of versioning (documented below)
acl str
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
bucket_domain_name str
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucket_urn str
The uniform resource name for the bucket
cors_rules Sequence[SpacesBucketCorsRuleArgs]
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

endpoint str
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
force_destroy bool
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycle_rules Sequence[SpacesBucketLifecycleRuleArgs]
A configuration of object lifecycle management (documented below).
name str
The name of the bucket
region Changes to this property will trigger replacement. str | Region
The region where the bucket resides (Defaults to nyc3)
versioning SpacesBucketVersioningArgs
A state of versioning (documented below)
acl String
Canned ACL applied on bucket creation: private or public-read (Defaults to private)
bucketDomainName String
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
bucketUrn String
The uniform resource name for the bucket
corsRules List<Property Map>
A rule of Cross-Origin Resource Sharing (documented below).

Deprecated: Terraform will only perform drift detection if a configuration value is provided. Use the resource digitalocean.SpacesBucketCorsConfiguration instead.

endpoint String
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
forceDestroy Boolean
Unless true, the bucket will only be destroyed if empty (Defaults to false)
lifecycleRules List<Property Map>
A configuration of object lifecycle management (documented below).
name String
The name of the bucket
region Changes to this property will trigger replacement. String | "nyc1" | "nyc2" | "nyc3" | "sgp1" | "lon1" | "ams2" | "ams3" | "fra1" | "tor1" | "sfo1" | "sfo2" | "sfo3" | "blr1" | "syd1"
The region where the bucket resides (Defaults to nyc3)
versioning Property Map
A state of versioning (documented below)

Supporting Types

Region
, RegionArgs

NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
RegionNYC1
nyc1
RegionNYC2
nyc2
RegionNYC3
nyc3
RegionSGP1
sgp1
RegionLON1
lon1
RegionAMS2
ams2
RegionAMS3
ams3
RegionFRA1
fra1
RegionTOR1
tor1
RegionSFO1
sfo1
RegionSFO2
sfo2
RegionSFO3
sfo3
RegionBLR1
blr1
RegionSYD1
syd1
NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
"nyc1"
nyc1
"nyc2"
nyc2
"nyc3"
nyc3
"sgp1"
sgp1
"lon1"
lon1
"ams2"
ams2
"ams3"
ams3
"fra1"
fra1
"tor1"
tor1
"sfo1"
sfo1
"sfo2"
sfo2
"sfo3"
sfo3
"blr1"
blr1
"syd1"
syd1

SpacesBucketCorsRule
, SpacesBucketCorsRuleArgs

AllowedMethods This property is required. List<string>
A list of HTTP methods (e.g. GET) which are allowed from the specified origin.
AllowedOrigins This property is required. List<string>
A list of hosts from which requests using the specified methods are allowed. A host may contain one wildcard (e.g. http://*.example.com).
AllowedHeaders List<string>
A list of headers that will be included in the CORS preflight request's Access-Control-Request-Headers. A header may contain one wildcard (e.g. x-amz-*).
MaxAgeSeconds int
The time in seconds that browser can cache the response for a preflight request.
AllowedMethods This property is required. []string
A list of HTTP methods (e.g. GET) which are allowed from the specified origin.
AllowedOrigins This property is required. []string
A list of hosts from which requests using the specified methods are allowed. A host may contain one wildcard (e.g. http://*.example.com).
AllowedHeaders []string
A list of headers that will be included in the CORS preflight request's Access-Control-Request-Headers. A header may contain one wildcard (e.g. x-amz-*).
MaxAgeSeconds int
The time in seconds that browser can cache the response for a preflight request.
allowedMethods This property is required. List<String>
A list of HTTP methods (e.g. GET) which are allowed from the specified origin.
allowedOrigins This property is required. List<String>
A list of hosts from which requests using the specified methods are allowed. A host may contain one wildcard (e.g. http://*.example.com).
allowedHeaders List<String>
A list of headers that will be included in the CORS preflight request's Access-Control-Request-Headers. A header may contain one wildcard (e.g. x-amz-*).
maxAgeSeconds Integer
The time in seconds that browser can cache the response for a preflight request.
allowedMethods This property is required. string[]
A list of HTTP methods (e.g. GET) which are allowed from the specified origin.
allowedOrigins This property is required. string[]
A list of hosts from which requests using the specified methods are allowed. A host may contain one wildcard (e.g. http://*.example.com).
allowedHeaders string[]
A list of headers that will be included in the CORS preflight request's Access-Control-Request-Headers. A header may contain one wildcard (e.g. x-amz-*).
maxAgeSeconds number
The time in seconds that browser can cache the response for a preflight request.
allowed_methods This property is required. Sequence[str]
A list of HTTP methods (e.g. GET) which are allowed from the specified origin.
allowed_origins This property is required. Sequence[str]
A list of hosts from which requests using the specified methods are allowed. A host may contain one wildcard (e.g. http://*.example.com).
allowed_headers Sequence[str]
A list of headers that will be included in the CORS preflight request's Access-Control-Request-Headers. A header may contain one wildcard (e.g. x-amz-*).
max_age_seconds int
The time in seconds that browser can cache the response for a preflight request.
allowedMethods This property is required. List<String>
A list of HTTP methods (e.g. GET) which are allowed from the specified origin.
allowedOrigins This property is required. List<String>
A list of hosts from which requests using the specified methods are allowed. A host may contain one wildcard (e.g. http://*.example.com).
allowedHeaders List<String>
A list of headers that will be included in the CORS preflight request's Access-Control-Request-Headers. A header may contain one wildcard (e.g. x-amz-*).
maxAgeSeconds Number
The time in seconds that browser can cache the response for a preflight request.

SpacesBucketLifecycleRule
, SpacesBucketLifecycleRuleArgs

Enabled This property is required. bool
Specifies lifecycle rule status.
AbortIncompleteMultipartUploadDays int
Specifies the number of days after initiating a multipart upload when the multipart upload must be completed or else Spaces will abort the upload.
Expiration Pulumi.DigitalOcean.Inputs.SpacesBucketLifecycleRuleExpiration
Specifies a time period after which applicable objects expire (documented below).
Id string
Unique identifier for the rule.
NoncurrentVersionExpiration Pulumi.DigitalOcean.Inputs.SpacesBucketLifecycleRuleNoncurrentVersionExpiration

Specifies when non-current object versions expire (documented below).

At least one of expiration or noncurrent_version_expiration must be specified.

Prefix string
Object key prefix identifying one or more objects to which the rule applies.
Enabled This property is required. bool
Specifies lifecycle rule status.
AbortIncompleteMultipartUploadDays int
Specifies the number of days after initiating a multipart upload when the multipart upload must be completed or else Spaces will abort the upload.
Expiration SpacesBucketLifecycleRuleExpiration
Specifies a time period after which applicable objects expire (documented below).
Id string
Unique identifier for the rule.
NoncurrentVersionExpiration SpacesBucketLifecycleRuleNoncurrentVersionExpiration

Specifies when non-current object versions expire (documented below).

At least one of expiration or noncurrent_version_expiration must be specified.

Prefix string
Object key prefix identifying one or more objects to which the rule applies.
enabled This property is required. Boolean
Specifies lifecycle rule status.
abortIncompleteMultipartUploadDays Integer
Specifies the number of days after initiating a multipart upload when the multipart upload must be completed or else Spaces will abort the upload.
expiration SpacesBucketLifecycleRuleExpiration
Specifies a time period after which applicable objects expire (documented below).
id String
Unique identifier for the rule.
noncurrentVersionExpiration SpacesBucketLifecycleRuleNoncurrentVersionExpiration

Specifies when non-current object versions expire (documented below).

At least one of expiration or noncurrent_version_expiration must be specified.

prefix String
Object key prefix identifying one or more objects to which the rule applies.
enabled This property is required. boolean
Specifies lifecycle rule status.
abortIncompleteMultipartUploadDays number
Specifies the number of days after initiating a multipart upload when the multipart upload must be completed or else Spaces will abort the upload.
expiration SpacesBucketLifecycleRuleExpiration
Specifies a time period after which applicable objects expire (documented below).
id string
Unique identifier for the rule.
noncurrentVersionExpiration SpacesBucketLifecycleRuleNoncurrentVersionExpiration

Specifies when non-current object versions expire (documented below).

At least one of expiration or noncurrent_version_expiration must be specified.

prefix string
Object key prefix identifying one or more objects to which the rule applies.
enabled This property is required. bool
Specifies lifecycle rule status.
abort_incomplete_multipart_upload_days int
Specifies the number of days after initiating a multipart upload when the multipart upload must be completed or else Spaces will abort the upload.
expiration SpacesBucketLifecycleRuleExpiration
Specifies a time period after which applicable objects expire (documented below).
id str
Unique identifier for the rule.
noncurrent_version_expiration SpacesBucketLifecycleRuleNoncurrentVersionExpiration

Specifies when non-current object versions expire (documented below).

At least one of expiration or noncurrent_version_expiration must be specified.

prefix str
Object key prefix identifying one or more objects to which the rule applies.
enabled This property is required. Boolean
Specifies lifecycle rule status.
abortIncompleteMultipartUploadDays Number
Specifies the number of days after initiating a multipart upload when the multipart upload must be completed or else Spaces will abort the upload.
expiration Property Map
Specifies a time period after which applicable objects expire (documented below).
id String
Unique identifier for the rule.
noncurrentVersionExpiration Property Map

Specifies when non-current object versions expire (documented below).

At least one of expiration or noncurrent_version_expiration must be specified.

prefix String
Object key prefix identifying one or more objects to which the rule applies.

SpacesBucketLifecycleRuleExpiration
, SpacesBucketLifecycleRuleExpirationArgs

Date string
Specifies the date/time after which you want applicable objects to expire. The argument uses RFC3339 format, e.g. "2020-03-22T15:03:55Z" or parts thereof e.g. "2019-02-28".
Days int
Specifies the number of days after object creation when the applicable objects will expire.
ExpiredObjectDeleteMarker bool
On a versioned bucket (versioning-enabled or versioning-suspended bucket), setting this to true directs Spaces to delete expired object delete markers.
Date string
Specifies the date/time after which you want applicable objects to expire. The argument uses RFC3339 format, e.g. "2020-03-22T15:03:55Z" or parts thereof e.g. "2019-02-28".
Days int
Specifies the number of days after object creation when the applicable objects will expire.
ExpiredObjectDeleteMarker bool
On a versioned bucket (versioning-enabled or versioning-suspended bucket), setting this to true directs Spaces to delete expired object delete markers.
date String
Specifies the date/time after which you want applicable objects to expire. The argument uses RFC3339 format, e.g. "2020-03-22T15:03:55Z" or parts thereof e.g. "2019-02-28".
days Integer
Specifies the number of days after object creation when the applicable objects will expire.
expiredObjectDeleteMarker Boolean
On a versioned bucket (versioning-enabled or versioning-suspended bucket), setting this to true directs Spaces to delete expired object delete markers.
date string
Specifies the date/time after which you want applicable objects to expire. The argument uses RFC3339 format, e.g. "2020-03-22T15:03:55Z" or parts thereof e.g. "2019-02-28".
days number
Specifies the number of days after object creation when the applicable objects will expire.
expiredObjectDeleteMarker boolean
On a versioned bucket (versioning-enabled or versioning-suspended bucket), setting this to true directs Spaces to delete expired object delete markers.
date str
Specifies the date/time after which you want applicable objects to expire. The argument uses RFC3339 format, e.g. "2020-03-22T15:03:55Z" or parts thereof e.g. "2019-02-28".
days int
Specifies the number of days after object creation when the applicable objects will expire.
expired_object_delete_marker bool
On a versioned bucket (versioning-enabled or versioning-suspended bucket), setting this to true directs Spaces to delete expired object delete markers.
date String
Specifies the date/time after which you want applicable objects to expire. The argument uses RFC3339 format, e.g. "2020-03-22T15:03:55Z" or parts thereof e.g. "2019-02-28".
days Number
Specifies the number of days after object creation when the applicable objects will expire.
expiredObjectDeleteMarker Boolean
On a versioned bucket (versioning-enabled or versioning-suspended bucket), setting this to true directs Spaces to delete expired object delete markers.

SpacesBucketLifecycleRuleNoncurrentVersionExpiration
, SpacesBucketLifecycleRuleNoncurrentVersionExpirationArgs

Days int
Specifies the number of days after which an object's non-current versions expire.
Days int
Specifies the number of days after which an object's non-current versions expire.
days Integer
Specifies the number of days after which an object's non-current versions expire.
days number
Specifies the number of days after which an object's non-current versions expire.
days int
Specifies the number of days after which an object's non-current versions expire.
days Number
Specifies the number of days after which an object's non-current versions expire.

SpacesBucketVersioning
, SpacesBucketVersioningArgs

Enabled bool
Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.
Enabled bool
Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.
enabled Boolean
Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.
enabled boolean
Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.
enabled bool
Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.
enabled Boolean
Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.

Import

Buckets can be imported using the region and name attributes (delimited by a comma):

$ pulumi import digitalocean:index/spacesBucket:SpacesBucket foobar `region`,`name`
Copy

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

Package Details

Repository
DigitalOcean pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.