1. Packages
  2. Digitalocean Provider
  3. API Docs
  4. getSpacesBucket
DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 by Pulumi

digitalocean.getSpacesBucket

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: digitalocean:getSpacesBucket
          Arguments:
            name: my-spaces-bucket
            region: nyc3
    outputs:
      bucketDomainName: ${example.bucketDomainName}
    

    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>
    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]
    func LookupSpacesBucket(ctx *Context, args *LookupSpacesBucketArgs, opts ...InvokeOption) (*LookupSpacesBucketResult, error)
    func LookupSpacesBucketOutput(ctx *Context, args *LookupSpacesBucketOutputArgs, opts ...InvokeOption) LookupSpacesBucketResultOutput

    > 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)
    }
    public static CompletableFuture<GetSpacesBucketResult> getSpacesBucket(GetSpacesBucketArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: digitalocean:index/getSpacesBucket:getSpacesBucket
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Spaces bucket.
    Region string
    The slug of the region where the bucket is stored.
    Name string
    The name of the Spaces bucket.
    Region string
    The slug of the region where the bucket is stored.
    name String
    The name of the Spaces bucket.
    region String
    The slug of the region where the bucket is stored.
    name string
    The name of the Spaces bucket.
    region string
    The slug of the region where the bucket is stored.
    name str
    The name of the Spaces bucket.
    region str
    The slug of the region where the bucket is stored.
    name String
    The name of the Spaces bucket.
    region 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 logo
    DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 by Pulumi