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 (
bodyfield) is available only for objects which have a human-readableContent-Type(text/*andapplication/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
LookupSpacesBucketObjectin the Go SDK.
public static class GetSpacesBucketObject {
public static Task<GetSpacesBucketObjectResult> InvokeAsync(GetSpacesBucketObjectArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
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
- Cache
Control string Specifies caching behavior along the request/reply chain.
- Content
Disposition string Specifies presentational information for the object.
- Content
Encoding 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.
- Content
Language string The language the content is in.
- Content
Length int Size of the body in bytes.
- Content
Type 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
- Last
Modified 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
- Version
Id string The latest version ID of the object returned.
- Website
Redirect stringLocation 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
- Cache
Control string Specifies caching behavior along the request/reply chain.
- Content
Disposition string Specifies presentational information for the object.
- Content
Encoding 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.
- Content
Language string The language the content is in.
- Content
Length int Size of the body in bytes.
- Content
Type 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
- Last
Modified 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
- Version
Id string The latest version ID of the object returned.
- Website
Redirect stringLocation 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
- cache
Control string Specifies caching behavior along the request/reply chain.
- content
Disposition string Specifies presentational information for the object.
- content
Encoding 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.
- content
Language string The language the content is in.
- content
Length number Size of the body in bytes.
- content
Type 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
- last
Modified 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
- version
Id string The latest version ID of the object returned.
- website
Redirect stringLocation 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_ strlocation 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
digitaloceanTerraform Provider.