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",
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class SpacesBucket : CustomResource
Constructors
View SourceSpacesBucket(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 SourceAcl
Canned ACL applied on bucket creation (private or public-read)
Declaration
public Output<string> Acl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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>> |
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>> |
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>> |
Name
The name of the bucket
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The region where the bucket resides (Defaults to nyc3)
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Urn
The uniform resource name for the bucket
Declaration
public Output<string> Urn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Versioning
A state of versioning (documented below)
Declaration
public Output<SpacesBucketVersioning> Versioning { get; }
Property Value
| Type | Description |
|---|---|
| Output<SpacesBucketVersioning> |
Methods
View SourceGet(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 |