SpacesBucketObject

Provides a bucket object resource for Spaces, DigitalOcean’s object storage product. The digitalocean..SpacesBucketObject resource allows this provider to upload content to Spaces.

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", {});
// ...
import pulumi
import pulumi_digitalocean as digitalocean

static_assets = digitalocean.SpacesBucket("static-assets")
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 Key in a Spaces Bucket

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var foobar = new DigitalOcean.SpacesBucket("foobar", new DigitalOcean.SpacesBucketArgs
        {
            Region = "nyc3",
        });
        var index = new DigitalOcean.SpacesBucketObject("index", new DigitalOcean.SpacesBucketObjectArgs
        {
            Region = foobar.Region,
            Bucket = foobar.Name,
            Key = "index.html",
            Content = "<html><body><p>This page is empty.</p></body></html>",
            ContentType = "text/html",
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

foobar = digitalocean.SpacesBucket("foobar", region="nyc3")
index = digitalocean.SpacesBucketObject("index",
    region=foobar.region,
    bucket=foobar.name,
    key="index.html",
    content="<html><body><p>This page is empty.</p></body></html>",
    content_type="text/html")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const foobar = new digitalocean.SpacesBucket("foobar", {region: "nyc3"});
const index = new digitalocean.SpacesBucketObject("index", {
    region: foobar.region,
    bucket: foobar.name,
    key: "index.html",
    content: "<html><body><p>This page is empty.</p></body></html>",
    contentType: "text/html",
});

Create a SpacesBucketObject Resource

def SpacesBucketObject(resource_name, opts=None, acl=None, bucket=None, cache_control=None, content=None, content_base64=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, etag=None, force_destroy=None, key=None, metadata=None, region=None, source=None, website_redirect=None, __props__=None);
name string
The unique name of the resource.
args SpacesBucketObjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SpacesBucketObjectArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SpacesBucketObjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

SpacesBucketObject Resource Properties

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

Inputs

The SpacesBucketObject resource accepts the following input properties:

Bucket string

The name of the bucket to put the file in.

Key string

The name of the object once it is in the bucket.

Region string

The region where the bucket resides (Defaults to nyc3)

Acl string

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

CacheControl string

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

Content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

ContentBase64 string

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

ContentDisposition string

Specifies presentational information for the object. Read w3c content_disposition for further information.

ContentEncoding string

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

ContentLanguage string

The language the content is in e.g. en-US or en-GB.

ContentType string

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

Etag string

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

ForceDestroy bool

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

Metadata Dictionary<string, string>

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

Source string

The path to a file that will be read and uploaded as raw bytes for the object content.

WebsiteRedirect string

Specifies a target URL for website redirect.

Bucket string

The name of the bucket to put the file in.

Key string

The name of the object once it is in the bucket.

Region string

The region where the bucket resides (Defaults to nyc3)

Acl string

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

CacheControl string

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

Content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

ContentBase64 string

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

ContentDisposition string

Specifies presentational information for the object. Read w3c content_disposition for further information.

ContentEncoding string

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

ContentLanguage string

The language the content is in e.g. en-US or en-GB.

ContentType string

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

Etag string

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

ForceDestroy bool

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

Metadata map[string]string

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

Source string

The path to a file that will be read and uploaded as raw bytes for the object content.

WebsiteRedirect string

Specifies a target URL for website redirect.

bucket string

The name of the bucket to put the file in.

key string

The name of the object once it is in the bucket.

region string

The region where the bucket resides (Defaults to nyc3)

acl string

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

cacheControl string

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

contentBase64 string

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

contentDisposition string

Specifies presentational information for the object. Read w3c content_disposition for further information.

contentEncoding string

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

contentLanguage string

The language the content is in e.g. en-US or en-GB.

contentType string

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

etag string

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

forceDestroy boolean

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

metadata {[key: string]: string}

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

source string

The path to a file that will be read and uploaded as raw bytes for the object content.

websiteRedirect string

Specifies a target URL for website redirect.

bucket str

The name of the bucket to put the file in.

key str

The name of the object once it is in the bucket.

region str

The region where the bucket resides (Defaults to nyc3)

acl str

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

cache_control str

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

content str

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

content_base64 str

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

content_disposition str

Specifies presentational information for the object. Read w3c content_disposition for further information.

content_encoding str

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

content_language str

The language the content is in e.g. en-US or en-GB.

content_type str

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

etag str

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

force_destroy bool

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

metadata Dict[str, str]

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

source str

The path to a file that will be read and uploaded as raw bytes for the object content.

website_redirect str

Specifies a target URL for website redirect.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

Id string
The provider-assigned unique ID for this managed resource.
VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

id string
The provider-assigned unique ID for this managed resource.
versionId string

A unique version ID value for the object, if bucket versioning is enabled.

id str
The provider-assigned unique ID for this managed resource.
version_id str

A unique version ID value for the object, if bucket versioning is enabled.

Look up an Existing SpacesBucketObject Resource

Get an existing SpacesBucketObject 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?: SpacesBucketObjectState, opts?: CustomResourceOptions): SpacesBucketObject
static get(resource_name, id, opts=None, acl=None, bucket=None, cache_control=None, content=None, content_base64=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, etag=None, force_destroy=None, key=None, metadata=None, region=None, source=None, version_id=None, website_redirect=None, __props__=None);
func GetSpacesBucketObject(ctx *Context, name string, id IDInput, state *SpacesBucketObjectState, opts ...ResourceOption) (*SpacesBucketObject, error)
public static SpacesBucketObject Get(string name, Input<string> id, SpacesBucketObjectState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Acl string

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

Bucket string

The name of the bucket to put the file in.

CacheControl string

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

Content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

ContentBase64 string

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

ContentDisposition string

Specifies presentational information for the object. Read w3c content_disposition for further information.

ContentEncoding string

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

ContentLanguage string

The language the content is in e.g. en-US or en-GB.

ContentType string

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

Etag string

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

ForceDestroy bool

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

Key string

The name of the object once it is in the bucket.

Metadata Dictionary<string, string>

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

Region string

The region where the bucket resides (Defaults to nyc3)

Source string

The path to a file that will be read and uploaded as raw bytes for the object content.

VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

WebsiteRedirect string

Specifies a target URL for website redirect.

Acl string

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

Bucket string

The name of the bucket to put the file in.

CacheControl string

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

Content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

ContentBase64 string

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

ContentDisposition string

Specifies presentational information for the object. Read w3c content_disposition for further information.

ContentEncoding string

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

ContentLanguage string

The language the content is in e.g. en-US or en-GB.

ContentType string

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

Etag string

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

ForceDestroy bool

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

Key string

The name of the object once it is in the bucket.

Metadata map[string]string

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

Region string

The region where the bucket resides (Defaults to nyc3)

Source string

The path to a file that will be read and uploaded as raw bytes for the object content.

VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

WebsiteRedirect string

Specifies a target URL for website redirect.

acl string

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

bucket string

The name of the bucket to put the file in.

cacheControl string

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

contentBase64 string

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

contentDisposition string

Specifies presentational information for the object. Read w3c content_disposition for further information.

contentEncoding string

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

contentLanguage string

The language the content is in e.g. en-US or en-GB.

contentType string

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

etag string

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

forceDestroy boolean

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

key string

The name of the object once it is in the bucket.

metadata {[key: string]: string}

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

region string

The region where the bucket resides (Defaults to nyc3)

source string

The path to a file that will be read and uploaded as raw bytes for the object content.

versionId string

A unique version ID value for the object, if bucket versioning is enabled.

websiteRedirect string

Specifies a target URL for website redirect.

acl str

The canned ACL to apply. DigitalOcean supports “private” and “public-read”. (Defaults to “private”.)

bucket str

The name of the bucket to put the file in.

cache_control str

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

content str

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

content_base64 str

Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file.

content_disposition str

Specifies presentational information for the object. Read w3c content_disposition for further information.

content_encoding str

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information.

content_language str

The language the content is in e.g. en-US or en-GB.

content_type str

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

etag str

Used to trigger updates. The only meaningful value is ${filemd5("path/to/file")}.

force_destroy bool

Allow the object to be deleted by removing any legal hold on any object version. Default is false. This value should be set to true only if the bucket has S3 object lock enabled.

key str

The name of the object once it is in the bucket.

metadata Dict[str, str]

A mapping of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API).

region str

The region where the bucket resides (Defaults to nyc3)

source str

The path to a file that will be read and uploaded as raw bytes for the object content.

version_id str

A unique version ID value for the object, if bucket versioning is enabled.

website_redirect str

Specifies a target URL for website redirect.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.