digitalocean.getSpacesBuckets
Explore with Pulumi AI
Get information on Spaces buckets for use in other resources, with the ability to filter and sort the results. If no filters are specified, all Spaces buckets will be returned.
Note: You can use the digitalocean.SpacesBucket
data source to
obtain metadata about a single bucket if you already know its name
and region
.
Example Usage
Use the filter
block with a key
string and values
list to filter buckets.
Get all buckets in a region:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const nyc3 = digitalocean.getSpacesBuckets({
filters: [{
key: "region",
values: ["nyc3"],
}],
});
import pulumi
import pulumi_digitalocean as digitalocean
nyc3 = digitalocean.get_spaces_buckets(filters=[{
"key": "region",
"values": ["nyc3"],
}])
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 {
_, err := digitalocean.GetSpacesBuckets(ctx, &digitalocean.GetSpacesBucketsArgs{
Filters: []digitalocean.GetSpacesBucketsFilter{
{
Key: "region",
Values: []string{
"nyc3",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var nyc3 = DigitalOcean.GetSpacesBuckets.Invoke(new()
{
Filters = new[]
{
new DigitalOcean.Inputs.GetSpacesBucketsFilterInputArgs
{
Key = "region",
Values = new[]
{
"nyc3",
},
},
},
});
});
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.GetSpacesBucketsArgs;
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 nyc3 = DigitaloceanFunctions.getSpacesBuckets(GetSpacesBucketsArgs.builder()
.filters(GetSpacesBucketsFilterArgs.builder()
.key("region")
.values("nyc3")
.build())
.build());
}
}
variables:
nyc3:
fn::invoke:
Function: digitalocean:getSpacesBuckets
Arguments:
filters:
- key: region
values:
- nyc3
You can sort the results as well:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const nyc3 = digitalocean.getSpacesBuckets({
filters: [{
key: "region",
values: ["nyc3"],
}],
sorts: [{
key: "name",
direction: "desc",
}],
});
import pulumi
import pulumi_digitalocean as digitalocean
nyc3 = digitalocean.get_spaces_buckets(filters=[{
"key": "region",
"values": ["nyc3"],
}],
sorts=[{
"key": "name",
"direction": "desc",
}])
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 {
_, err := digitalocean.GetSpacesBuckets(ctx, &digitalocean.GetSpacesBucketsArgs{
Filters: []digitalocean.GetSpacesBucketsFilter{
{
Key: "region",
Values: []string{
"nyc3",
},
},
},
Sorts: []digitalocean.GetSpacesBucketsSort{
{
Key: "name",
Direction: pulumi.StringRef("desc"),
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var nyc3 = DigitalOcean.GetSpacesBuckets.Invoke(new()
{
Filters = new[]
{
new DigitalOcean.Inputs.GetSpacesBucketsFilterInputArgs
{
Key = "region",
Values = new[]
{
"nyc3",
},
},
},
Sorts = new[]
{
new DigitalOcean.Inputs.GetSpacesBucketsSortInputArgs
{
Key = "name",
Direction = "desc",
},
},
});
});
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.GetSpacesBucketsArgs;
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 nyc3 = DigitaloceanFunctions.getSpacesBuckets(GetSpacesBucketsArgs.builder()
.filters(GetSpacesBucketsFilterArgs.builder()
.key("region")
.values("nyc3")
.build())
.sorts(GetSpacesBucketsSortArgs.builder()
.key("name")
.direction("desc")
.build())
.build());
}
}
variables:
nyc3:
fn::invoke:
Function: digitalocean:getSpacesBuckets
Arguments:
filters:
- key: region
values:
- nyc3
sorts:
- key: name
direction: desc
Using getSpacesBuckets
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 getSpacesBuckets(args: GetSpacesBucketsArgs, opts?: InvokeOptions): Promise<GetSpacesBucketsResult>
function getSpacesBucketsOutput(args: GetSpacesBucketsOutputArgs, opts?: InvokeOptions): Output<GetSpacesBucketsResult>
def get_spaces_buckets(filters: Optional[Sequence[GetSpacesBucketsFilter]] = None,
sorts: Optional[Sequence[GetSpacesBucketsSort]] = None,
opts: Optional[InvokeOptions] = None) -> GetSpacesBucketsResult
def get_spaces_buckets_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSpacesBucketsFilterArgs]]]] = None,
sorts: Optional[pulumi.Input[Sequence[pulumi.Input[GetSpacesBucketsSortArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSpacesBucketsResult]
func GetSpacesBuckets(ctx *Context, args *GetSpacesBucketsArgs, opts ...InvokeOption) (*GetSpacesBucketsResult, error)
func GetSpacesBucketsOutput(ctx *Context, args *GetSpacesBucketsOutputArgs, opts ...InvokeOption) GetSpacesBucketsResultOutput
> Note: This function is named GetSpacesBuckets
in the Go SDK.
public static class GetSpacesBuckets
{
public static Task<GetSpacesBucketsResult> InvokeAsync(GetSpacesBucketsArgs args, InvokeOptions? opts = null)
public static Output<GetSpacesBucketsResult> Invoke(GetSpacesBucketsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSpacesBucketsResult> getSpacesBuckets(GetSpacesBucketsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: digitalocean:index/getSpacesBuckets:getSpacesBuckets
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Pulumi.
Digital Ocean. Inputs. Get Spaces Buckets Filter> - Filter the results.
The
filter
block is documented below. - Sorts
List<Pulumi.
Digital Ocean. Inputs. Get Spaces Buckets Sort> - Sort the results.
The
sort
block is documented below.
- Filters
[]Get
Spaces Buckets Filter - Filter the results.
The
filter
block is documented below. - Sorts
[]Get
Spaces Buckets Sort - Sort the results.
The
sort
block is documented below.
- filters
List<Get
Spaces Buckets Filter> - Filter the results.
The
filter
block is documented below. - sorts
List<Get
Spaces Buckets Sort> - Sort the results.
The
sort
block is documented below.
- filters
Get
Spaces Buckets Filter[] - Filter the results.
The
filter
block is documented below. - sorts
Get
Spaces Buckets Sort[] - Sort the results.
The
sort
block is documented below.
- filters
Sequence[Get
Spaces Buckets Filter] - Filter the results.
The
filter
block is documented below. - sorts
Sequence[Get
Spaces Buckets Sort] - Sort the results.
The
sort
block is documented below.
- filters List<Property Map>
- Filter the results.
The
filter
block is documented below. - sorts List<Property Map>
- Sort the results.
The
sort
block is documented below.
getSpacesBuckets Result
The following output properties are available:
- Buckets
List<Pulumi.
Digital Ocean. Outputs. Get Spaces Buckets Bucket> - A list of Spaces buckets satisfying any
filter
andsort
criteria. Each bucket has the following attributes: - Id string
- The provider-assigned unique ID for this managed resource.
- Filters
List<Pulumi.
Digital Ocean. Outputs. Get Spaces Buckets Filter> - Sorts
List<Pulumi.
Digital Ocean. Outputs. Get Spaces Buckets Sort>
- Buckets
[]Get
Spaces Buckets Bucket - A list of Spaces buckets satisfying any
filter
andsort
criteria. Each bucket has the following attributes: - Id string
- The provider-assigned unique ID for this managed resource.
- Filters
[]Get
Spaces Buckets Filter - Sorts
[]Get
Spaces Buckets Sort
- buckets
List<Get
Spaces Buckets Bucket> - A list of Spaces buckets satisfying any
filter
andsort
criteria. Each bucket has the following attributes: - id String
- The provider-assigned unique ID for this managed resource.
- filters
List<Get
Spaces Buckets Filter> - sorts
List<Get
Spaces Buckets Sort>
- buckets
Get
Spaces Buckets Bucket[] - A list of Spaces buckets satisfying any
filter
andsort
criteria. Each bucket has the following attributes: - id string
- The provider-assigned unique ID for this managed resource.
- filters
Get
Spaces Buckets Filter[] - sorts
Get
Spaces Buckets Sort[]
- buckets
Sequence[Get
Spaces Buckets Bucket] - A list of Spaces buckets satisfying any
filter
andsort
criteria. Each bucket has the following attributes: - id str
- The provider-assigned unique ID for this managed resource.
- filters
Sequence[Get
Spaces Buckets Filter] - sorts
Sequence[Get
Spaces Buckets Sort]
- buckets List<Property Map>
- A list of Spaces buckets satisfying any
filter
andsort
criteria. Each bucket has the following attributes: - id String
- The provider-assigned unique ID for this managed resource.
- filters List<Property Map>
- sorts List<Property Map>
Supporting Types
GetSpacesBucketsBucket
- Bucket
Domain stringName - 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)
- 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 stringName - 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)
- 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 StringName - 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)
- 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 stringName - 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)
- 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_ strname - 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)
- 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
- bucket
Domain StringName - 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)
- 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
GetSpacesBucketsFilter
- Key string
- Filter the images by this key. This may be one of
bucket_domain_name
,name
,region
, orurn
. - Values List<string>
- A list of values to match against the
key
field. Only retrieves Spaces buckets where thekey
field takes on one or more of the values provided here. - All bool
- Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set. - Match
By string - One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- Key string
- Filter the images by this key. This may be one of
bucket_domain_name
,name
,region
, orurn
. - Values []string
- A list of values to match against the
key
field. Only retrieves Spaces buckets where thekey
field takes on one or more of the values provided here. - All bool
- Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set. - Match
By string - One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key String
- Filter the images by this key. This may be one of
bucket_domain_name
,name
,region
, orurn
. - values List<String>
- A list of values to match against the
key
field. Only retrieves Spaces buckets where thekey
field takes on one or more of the values provided here. - all Boolean
- Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set. - match
By String - One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key string
- Filter the images by this key. This may be one of
bucket_domain_name
,name
,region
, orurn
. - values string[]
- A list of values to match against the
key
field. Only retrieves Spaces buckets where thekey
field takes on one or more of the values provided here. - all boolean
- Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set. - match
By string - One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key str
- Filter the images by this key. This may be one of
bucket_domain_name
,name
,region
, orurn
. - values Sequence[str]
- A list of values to match against the
key
field. Only retrieves Spaces buckets where thekey
field takes on one or more of the values provided here. - all bool
- Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set. - match_
by str - One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- key String
- Filter the images by this key. This may be one of
bucket_domain_name
,name
,region
, orurn
. - values List<String>
- A list of values to match against the
key
field. Only retrieves Spaces buckets where thekey
field takes on one or more of the values provided here. - all Boolean
- Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set. - match
By String - One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
GetSpacesBucketsSort
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.