GetSpacesBucketObject

The Spaces object data source allows access to the metadata and optionally (see below) content of an object stored inside a Spaces bucket.

Note: The content of an object (body field) is available only for objects which have a human-readable Content-Type (text/* and application/json). This is to prevent printing unsafe characters and potentially downloading large amount of data which would be thrown away in favor of metadata.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var bootstrapScript = Output.Create(DigitalOcean.GetSpacesBucketObject.InvokeAsync(new DigitalOcean.GetSpacesBucketObjectArgs
        {
            Bucket = "ourcorp-deploy-config",
            Region = "nyc3",
            Key = "droplet-bootstrap-script.sh",
        }));
        var web = new DigitalOcean.Droplet("web", new DigitalOcean.DropletArgs
        {
            Image = "ubuntu-18-04-x64",
            Region = "nyc2",
            Size = "s-1vcpu-1gb",
            UserData = bootstrapScript.Apply(bootstrapScript => bootstrapScript.Body),
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

bootstrap_script = digitalocean.get_spaces_bucket_object(bucket="ourcorp-deploy-config",
    region="nyc3",
    key="droplet-bootstrap-script.sh")
web = digitalocean.Droplet("web",
    image="ubuntu-18-04-x64",
    region="nyc2",
    size="s-1vcpu-1gb",
    user_data=bootstrap_script.body)
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const bootstrapScript = digitalocean.getSpacesBucketObject({
    bucket: "ourcorp-deploy-config",
    region: "nyc3",
    key: "droplet-bootstrap-script.sh",
});
const web = new digitalocean.Droplet("web", {
    image: "ubuntu-18-04-x64",
    region: "nyc2",
    size: "s-1vcpu-1gb",
    userData: bootstrapScript.then(bootstrapScript => bootstrapScript.body),
});

Using GetSpacesBucketObject

function getSpacesBucketObject(args: GetSpacesBucketObjectArgs, opts?: InvokeOptions): Promise<GetSpacesBucketObjectResult>
function  get_spaces_bucket_object(bucket=None, key=None, range=None, region=None, version_id=None, opts=None)
func LookupSpacesBucketObject(ctx *Context, args *LookupSpacesBucketObjectArgs, opts ...InvokeOption) (*LookupSpacesBucketObjectResult, error)

Note: This function is named LookupSpacesBucketObject in the Go SDK.

public static class GetSpacesBucketObject {
    public static Task<GetSpacesBucketObjectResult> InvokeAsync(GetSpacesBucketObjectArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Bucket string

The name of the bucket to read the object from.

Key string

The full path to the object inside the bucket

Region string

The slug of the region where the bucket is stored.

Range string
VersionId string

Specific version ID of the object returned (defaults to latest version)

Bucket string

The name of the bucket to read the object from.

Key string

The full path to the object inside the bucket

Region string

The slug of the region where the bucket is stored.

Range string
VersionId string

Specific version ID of the object returned (defaults to latest version)

bucket string

The name of the bucket to read the object from.

key string

The full path to the object inside the bucket

region string

The slug of the region where the bucket is stored.

range string
versionId string

Specific version ID of the object returned (defaults to latest version)

bucket str

The name of the bucket to read the object from.

key str

The full path to the object inside the bucket

region str

The slug of the region where the bucket is stored.

range str
version_id str

Specific version ID of the object returned (defaults to latest version)

GetSpacesBucketObject Result

The following output properties are available:

Body string

Object data (see limitations above to understand cases in which this field is actually available)

Bucket string
CacheControl string

Specifies caching behavior along the request/reply chain.

ContentDisposition string

Specifies presentational information for the object.

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.

ContentLanguage string

The language the content is in.

ContentLength int

Size of the body in bytes.

ContentType string

A standard MIME type describing the format of the object data.

Etag string

ETag generated for the object (an MD5 sum of the object content in case it’s not encrypted)

Expiration string

If the object expiration is configured (see object lifecycle management), the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

Expires string

The date and time at which the object is no longer cacheable.

Id string

The provider-assigned unique ID for this managed resource.

Key string
LastModified string

Last modified date of the object in RFC1123 format (e.g. Mon, 02 Jan 2006 15:04:05 MST)

Metadata Dictionary<string, object>

A map of metadata stored with the object in Spaces

Region string
VersionId string

The latest version ID of the object returned.

WebsiteRedirectLocation string

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Spaces stores the value of this header in the object metadata.

Range string
Body string

Object data (see limitations above to understand cases in which this field is actually available)

Bucket string
CacheControl string

Specifies caching behavior along the request/reply chain.

ContentDisposition string

Specifies presentational information for the object.

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.

ContentLanguage string

The language the content is in.

ContentLength int

Size of the body in bytes.

ContentType string

A standard MIME type describing the format of the object data.

Etag string

ETag generated for the object (an MD5 sum of the object content in case it’s not encrypted)

Expiration string

If the object expiration is configured (see object lifecycle management), the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

Expires string

The date and time at which the object is no longer cacheable.

Id string

The provider-assigned unique ID for this managed resource.

Key string
LastModified string

Last modified date of the object in RFC1123 format (e.g. Mon, 02 Jan 2006 15:04:05 MST)

Metadata map[string]interface{}

A map of metadata stored with the object in Spaces

Region string
VersionId string

The latest version ID of the object returned.

WebsiteRedirectLocation string

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Spaces stores the value of this header in the object metadata.

Range string
body string

Object data (see limitations above to understand cases in which this field is actually available)

bucket string
cacheControl string

Specifies caching behavior along the request/reply chain.

contentDisposition string

Specifies presentational information for the object.

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.

contentLanguage string

The language the content is in.

contentLength number

Size of the body in bytes.

contentType string

A standard MIME type describing the format of the object data.

etag string

ETag generated for the object (an MD5 sum of the object content in case it’s not encrypted)

expiration string

If the object expiration is configured (see object lifecycle management), the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

expires string

The date and time at which the object is no longer cacheable.

id string

The provider-assigned unique ID for this managed resource.

key string
lastModified string

Last modified date of the object in RFC1123 format (e.g. Mon, 02 Jan 2006 15:04:05 MST)

metadata {[key: string]: any}

A map of metadata stored with the object in Spaces

region string
versionId string

The latest version ID of the object returned.

websiteRedirectLocation string

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Spaces stores the value of this header in the object metadata.

range string
body str

Object data (see limitations above to understand cases in which this field is actually available)

bucket str
cache_control str

Specifies caching behavior along the request/reply chain.

content_disposition str

Specifies presentational information for the object.

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.

content_language str

The language the content is in.

content_length float

Size of the body in bytes.

content_type str

A standard MIME type describing the format of the object data.

etag str

ETag generated for the object (an MD5 sum of the object content in case it’s not encrypted)

expiration str

If the object expiration is configured (see object lifecycle management), the field includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

expires str

The date and time at which the object is no longer cacheable.

id str

The provider-assigned unique ID for this managed resource.

key str
last_modified str

Last modified date of the object in RFC1123 format (e.g. Mon, 02 Jan 2006 15:04:05 MST)

metadata Dict[str, Any]

A map of metadata stored with the object in Spaces

region str
version_id str

The latest version ID of the object returned.

website_redirect_location str

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Spaces stores the value of this header in the object metadata.

range str

Package Details

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