Viewing docs for DigitalOcean v4.63.0
published on Wednesday, Mar 25, 2026 by Pulumi
published on Wednesday, Mar 25, 2026 by Pulumi
Viewing docs for DigitalOcean v4.63.0
published on Wednesday, Mar 25, 2026 by Pulumi
published on Wednesday, Mar 25, 2026 by Pulumi
Get information on a Spaces key for use in other resources. This is useful if the Spaces key in question is not managed by Terraform or you need to utilize any of the key’s data.
Example Usage
Get the key by access key ID:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const example = digitalocean.getSpacesKey({
accessKey: "ACCESS_KEY_ID",
});
export const keyGrants = example.then(example => example.grants);
import pulumi
import pulumi_digitalocean as digitalocean
example = digitalocean.get_spaces_key(access_key="ACCESS_KEY_ID")
pulumi.export("keyGrants", example.grants)
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.LookupSpacesKey(ctx, &digitalocean.LookupSpacesKeyArgs{
AccessKey: "ACCESS_KEY_ID",
}, nil)
if err != nil {
return err
}
ctx.Export("keyGrants", example.Grants)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var example = DigitalOcean.GetSpacesKey.Invoke(new()
{
AccessKey = "ACCESS_KEY_ID",
});
return new Dictionary<string, object?>
{
["keyGrants"] = example.Apply(getSpacesKeyResult => getSpacesKeyResult.Grants),
};
});
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.GetSpacesKeyArgs;
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.getSpacesKey(GetSpacesKeyArgs.builder()
.accessKey("ACCESS_KEY_ID")
.build());
ctx.export("keyGrants", example.grants());
}
}
variables:
example:
fn::invoke:
function: digitalocean:getSpacesKey
arguments:
accessKey: ACCESS_KEY_ID
outputs:
keyGrants: ${example.grants}
Using getSpacesKey
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 getSpacesKey(args: GetSpacesKeyArgs, opts?: InvokeOptions): Promise<GetSpacesKeyResult>
function getSpacesKeyOutput(args: GetSpacesKeyOutputArgs, opts?: InvokeOptions): Output<GetSpacesKeyResult>def get_spaces_key(access_key: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSpacesKeyResult
def get_spaces_key_output(access_key: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSpacesKeyResult]func LookupSpacesKey(ctx *Context, args *LookupSpacesKeyArgs, opts ...InvokeOption) (*LookupSpacesKeyResult, error)
func LookupSpacesKeyOutput(ctx *Context, args *LookupSpacesKeyOutputArgs, opts ...InvokeOption) LookupSpacesKeyResultOutput> Note: This function is named LookupSpacesKey in the Go SDK.
public static class GetSpacesKey
{
public static Task<GetSpacesKeyResult> InvokeAsync(GetSpacesKeyArgs args, InvokeOptions? opts = null)
public static Output<GetSpacesKeyResult> Invoke(GetSpacesKeyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSpacesKeyResult> getSpacesKey(GetSpacesKeyArgs args, InvokeOptions options)
public static Output<GetSpacesKeyResult> getSpacesKey(GetSpacesKeyArgs args, InvokeOptions options)
fn::invoke:
function: digitalocean:index/getSpacesKey:getSpacesKey
arguments:
# arguments dictionaryThe following arguments are supported:
- Access
Key string - The Access Key ID of the Spaces key.
- Access
Key string - The Access Key ID of the Spaces key.
- access
Key String - The Access Key ID of the Spaces key.
- access
Key string - The Access Key ID of the Spaces key.
- access_
key str - The Access Key ID of the Spaces key.
- access
Key String - The Access Key ID of the Spaces key.
getSpacesKey Result
The following output properties are available:
- Access
Key string - The access key ID of the Spaces key
- Created
At string - The creation time of the Spaces key
- Grants
List<Pulumi.
Digital Ocean. Outputs. Get Spaces Key Grant> - The list of grants associated with the Spaces key.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the Spaces key
- access_
key str - The access key ID of the Spaces key
- created_
at str - The creation time of the Spaces key
- grants
Sequence[Get
Spaces Key Grant] - The list of grants associated with the Spaces key.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the Spaces key
Supporting Types
GetSpacesKeyGrant
- Bucket string
- The name of the bucket to grant the key access to.
- Permission string
- The permission to grant the key. Valid values are
read,readwrite, orfullaccess.
- Bucket string
- The name of the bucket to grant the key access to.
- Permission string
- The permission to grant the key. Valid values are
read,readwrite, orfullaccess.
- bucket String
- The name of the bucket to grant the key access to.
- permission String
- The permission to grant the key. Valid values are
read,readwrite, orfullaccess.
- bucket string
- The name of the bucket to grant the key access to.
- permission string
- The permission to grant the key. Valid values are
read,readwrite, orfullaccess.
- bucket str
- The name of the bucket to grant the key access to.
- permission str
- The permission to grant the key. Valid values are
read,readwrite, orfullaccess.
- bucket String
- The name of the bucket to grant the key access to.
- permission String
- The permission to grant the key. Valid values are
read,readwrite, orfullaccess.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
Viewing docs for DigitalOcean v4.63.0
published on Wednesday, Mar 25, 2026 by Pulumi
published on Wednesday, Mar 25, 2026 by Pulumi
