1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. getSpacesBucket
DigitalOcean v4.41.0 published on Wednesday, Mar 26, 2025 by Pulumi

digitalocean.getSpacesBucket

Explore with Pulumi AI

DigitalOcean v4.41.0 published on Wednesday, Mar 26, 2025 by Pulumi

Get information on a Spaces bucket for use in other resources. This is useful if the Spaces bucket in question is not managed by the provider or you need to utilize any of the bucket’s data.

Example Usage

Get the bucket by name:

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = digitalocean.getSpacesBucket({
    name: "my-spaces-bucket",
    region: "nyc3",
});
export const bucketDomainName = example.then(example => example.bucketDomainName);
Copy
import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_spaces_bucket(name="my-spaces-bucket",
    region="nyc3")
pulumi.export("bucketDomainName", example.bucket_domain_name)
Copy
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := digitalocean.LookupSpacesBucket(ctx, &digitalocean.LookupSpacesBucketArgs{
			Name:   "my-spaces-bucket",
			Region: "nyc3",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("bucketDomainName", example.BucketDomainName)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var example = DigitalOcean.GetSpacesBucket.Invoke(new()
    {
        Name = "my-spaces-bucket",
        Region = "nyc3",
    });

    return new Dictionary<string, object?>
    {
        ["bucketDomainName"] = example.Apply(getSpacesBucketResult => getSpacesBucketResult.BucketDomainName),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetSpacesBucketArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = DigitaloceanFunctions.getSpacesBucket(GetSpacesBucketArgs.builder()
            .name("my-spaces-bucket")
            .region("nyc3")
            .build());

        ctx.export("bucketDomainName", example.applyValue(getSpacesBucketResult -> getSpacesBucketResult.bucketDomainName()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: digitalocean:getSpacesBucket
      arguments:
        name: my-spaces-bucket
        region: nyc3
outputs:
  bucketDomainName: ${example.bucketDomainName}
Copy

Using getSpacesBucket

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSpacesBucket(args: GetSpacesBucketArgs, opts?: InvokeOptions): Promise<GetSpacesBucketResult>
function getSpacesBucketOutput(args: GetSpacesBucketOutputArgs, opts?: InvokeOptions): Output<GetSpacesBucketResult>
Copy
def get_spaces_bucket(name: Optional[str] = None,
                      region: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetSpacesBucketResult
def get_spaces_bucket_output(name: Optional[pulumi.Input[str]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetSpacesBucketResult]
Copy
func LookupSpacesBucket(ctx *Context, args *LookupSpacesBucketArgs, opts ...InvokeOption) (*LookupSpacesBucketResult, error)
func LookupSpacesBucketOutput(ctx *Context, args *LookupSpacesBucketOutputArgs, opts ...InvokeOption) LookupSpacesBucketResultOutput
Copy

> Note: This function is named LookupSpacesBucket in the Go SDK.

public static class GetSpacesBucket 
{
    public static Task<GetSpacesBucketResult> InvokeAsync(GetSpacesBucketArgs args, InvokeOptions? opts = null)
    public static Output<GetSpacesBucketResult> Invoke(GetSpacesBucketInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSpacesBucketResult> getSpacesBucket(GetSpacesBucketArgs args, InvokeOptions options)
public static Output<GetSpacesBucketResult> getSpacesBucket(GetSpacesBucketArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: digitalocean:index/getSpacesBucket:getSpacesBucket
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Spaces bucket.
Region This property is required. string
The slug of the region where the bucket is stored.
Name This property is required. string
The name of the Spaces bucket.
Region This property is required. string
The slug of the region where the bucket is stored.
name This property is required. String
The name of the Spaces bucket.
region This property is required. String
The slug of the region where the bucket is stored.
name This property is required. string
The name of the Spaces bucket.
region This property is required. string
The slug of the region where the bucket is stored.
name This property is required. str
The name of the Spaces bucket.
region This property is required. str
The slug of the region where the bucket is stored.
name This property is required. String
The name of the Spaces bucket.
region This property is required. String
The slug of the region where the bucket is stored.

getSpacesBucket Result

The following output properties are available:

BucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
Endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the Spaces bucket
Region string
The slug of the region where the bucket is stored.
Urn string
The uniform resource name of the bucket
BucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
Endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the Spaces bucket
Region string
The slug of the region where the bucket is stored.
Urn string
The uniform resource name of the bucket
bucketDomainName String
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
endpoint String
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the Spaces bucket
region String
The slug of the region where the bucket is stored.
urn String
The uniform resource name of the bucket
bucketDomainName string
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
endpoint string
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the Spaces bucket
region string
The slug of the region where the bucket is stored.
urn string
The uniform resource name of the bucket
bucket_domain_name str
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
endpoint str
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the Spaces bucket
region str
The slug of the region where the bucket is stored.
urn str
The uniform resource name of the bucket
bucketDomainName String
The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com)
endpoint String
The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com)
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the Spaces bucket
region String
The slug of the region where the bucket is stored.
urn String
The uniform resource name of the bucket

Package Details

Repository
DigitalOcean pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.
DigitalOcean v4.41.0 published on Wednesday, Mar 26, 2025 by Pulumi