Show / Hide Table of Contents

Class SpacesBucket

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:

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
public MyStack()
{
    var static_assets = new DigitalOcean.SpacesBucket("static-assets", new DigitalOcean.SpacesBucketArgs
    {
    });
    // ...
}

}

For more information, See An Introduction to DigitalOcean Spaces

Example Usage

Create a New Bucket

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
public MyStack()
{
    var foobar = new DigitalOcean.SpacesBucket("foobar", new DigitalOcean.SpacesBucketArgs
    {
        Region = "nyc3",
    });
}

}

Create a New Bucket With CORS Rules

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
public MyStack()
{
    var foobar = new DigitalOcean.SpacesBucket("foobar", new DigitalOcean.SpacesBucketArgs
    {
        CorsRules = 
        {
            new DigitalOcean.Inputs.SpacesBucketCorsRuleArgs
            {
                AllowedHeaders = 
                {
                    "*",
                },
                AllowedMethods = 
                {
                    "GET",
                },
                AllowedOrigins = 
                {
                    "*",
                },
                MaxAgeSeconds = 3000,
            },
            new DigitalOcean.Inputs.SpacesBucketCorsRuleArgs
            {
                AllowedHeaders = 
                {
                    "*",
                },
                AllowedMethods = 
                {
                    "PUT",
                    "POST",
                    "DELETE",
                },
                AllowedOrigins = 
                {
                    "https://www.example.com",
                },
                MaxAgeSeconds = 3000,
            },
        },
        Region = "nyc3",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
SpacesBucket
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class SpacesBucket : CustomResource

Constructors

View Source

SpacesBucket(String, SpacesBucketArgs, CustomResourceOptions)

Create a SpacesBucket resource with the given unique name, arguments, and options.

Declaration
public SpacesBucket(string name, SpacesBucketArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

SpacesBucketArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Acl

Canned ACL applied on bucket creation (private or public-read)

Declaration
public Output<string> Acl { get; }
Property Value
Type Description
Output<System.String>
View Source

BucketDomainName

The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)

Declaration
public Output<string> BucketDomainName { get; }
Property Value
Type Description
Output<System.String>
View Source

CorsRules

A rule of Cross-Origin Resource Sharing (documented below).

Declaration
public Output<ImmutableArray<SpacesBucketCorsRule>> CorsRules { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<SpacesBucketCorsRule>>
View Source

ForceDestroy

Unless true, the bucket will only be destroyed if empty (Defaults to false)

Declaration
public Output<bool?> ForceDestroy { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

LifecycleRules

A configuration of object lifecycle management (documented below).

Declaration
public Output<ImmutableArray<SpacesBucketLifecycleRule>> LifecycleRules { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<SpacesBucketLifecycleRule>>
View Source

Name

The name of the bucket

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Region

The region where the bucket resides (Defaults to nyc3)

Declaration
public Output<string> Region { get; }
Property Value
Type Description
Output<System.String>
View Source

Urn

The uniform resource name for the bucket

Declaration
public Output<string> Urn { get; }
Property Value
Type Description
Output<System.String>
View Source

Versioning

A state of versioning (documented below)

Declaration
public Output<SpacesBucketVersioning> Versioning { get; }
Property Value
Type Description
Output<SpacesBucketVersioning>

Methods

View Source

Get(String, Input<String>, SpacesBucketState, CustomResourceOptions)

Get an existing SpacesBucket resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static SpacesBucket Get(string name, Input<string> id, SpacesBucketState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

SpacesBucketState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
SpacesBucket
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.