Show / Hide Table of Contents

Class GetSpacesBucketObject

Inheritance
System.Object
GetSpacesBucketObject
Inherited Members
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 static class GetSpacesBucketObject

Methods

View Source

InvokeAsync(GetSpacesBucketObjectArgs, InvokeOptions)

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.

{{% examples %}}

Example Usage

{{% example %}}

The following example retrieves a text object (which must have a Content-Type value starting with text/) and uses it as the user_data for a Droplet:

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),
    });
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetSpacesBucketObjectResult> InvokeAsync(GetSpacesBucketObjectArgs args, InvokeOptions options = null)
Parameters
Type Name Description
GetSpacesBucketObjectArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetSpacesBucketObjectResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.