1. Packages
  2. Packages
  3. DigitalOcean Provider
  4. API Docs
  5. getDedicatedInferenceTokens
Viewing docs for DigitalOcean v4.65.0
published on Wednesday, Apr 29, 2026 by Pulumi
digitalocean logo
Viewing docs for DigitalOcean v4.65.0
published on Wednesday, Apr 29, 2026 by Pulumi

    Returns a list of API tokens for a dedicated inference endpoint, with the ability to filter and sort the results.

    Note: Token values (secrets) are not returned by this data source. Only token metadata (ID, name, creation time) is available.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const example = digitalocean.getDedicatedInferenceTokens({
        dedicatedInferenceId: exampleDigitaloceanDedicatedInference.id,
    });
    export const tokens = example.then(example => example.tokens);
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    example = digitalocean.get_dedicated_inference_tokens(dedicated_inference_id=example_digitalocean_dedicated_inference["id"])
    pulumi.export("tokens", example.tokens)
    
    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.GetDedicatedInferenceTokens(ctx, &digitalocean.GetDedicatedInferenceTokensArgs{
    			DedicatedInferenceId: exampleDigitaloceanDedicatedInference.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("tokens", example.Tokens)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var example = DigitalOcean.Index.GetDedicatedInferenceTokens.Invoke(new()
        {
            DedicatedInferenceId = exampleDigitaloceanDedicatedInference.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["tokens"] = example.Apply(getDedicatedInferenceTokensResult => getDedicatedInferenceTokensResult.Tokens),
        };
    });
    
    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.GetDedicatedInferenceTokensArgs;
    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.getDedicatedInferenceTokens(GetDedicatedInferenceTokensArgs.builder()
                .dedicatedInferenceId(exampleDigitaloceanDedicatedInference.id())
                .build());
    
            ctx.export("tokens", example.tokens());
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: digitalocean:getDedicatedInferenceTokens
          arguments:
            dedicatedInferenceId: ${exampleDigitaloceanDedicatedInference.id}
    outputs:
      tokens: ${example.tokens}
    

    Filter by name

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const filtered = digitalocean.getDedicatedInferenceTokens({
        dedicatedInferenceId: example.id,
        filters: [{
            key: "name",
            values: ["my-token"],
        }],
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    filtered = digitalocean.get_dedicated_inference_tokens(dedicated_inference_id=example["id"],
        filters=[{
            "key": "name",
            "values": ["my-token"],
        }])
    
    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.GetDedicatedInferenceTokens(ctx, &digitalocean.GetDedicatedInferenceTokensArgs{
    			DedicatedInferenceId: example.Id,
    			Filters: []digitalocean.GetDedicatedInferenceTokensFilter{
    				{
    					Key: "name",
    					Values: []string{
    						"my-token",
    					},
    				},
    			},
    		}, 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 filtered = DigitalOcean.Index.GetDedicatedInferenceTokens.Invoke(new()
        {
            DedicatedInferenceId = example.Id,
            Filters = new[]
            {
                new DigitalOcean.Inputs.GetDedicatedInferenceTokensFilterInputArgs
                {
                    Key = "name",
                    Values = new[]
                    {
                        "my-token",
                    },
                },
            },
        });
    
    });
    
    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.GetDedicatedInferenceTokensArgs;
    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 filtered = DigitaloceanFunctions.getDedicatedInferenceTokens(GetDedicatedInferenceTokensArgs.builder()
                .dedicatedInferenceId(example.id())
                .filters(GetDedicatedInferenceTokensFilterArgs.builder()
                    .key("name")
                    .values("my-token")
                    .build())
                .build());
    
        }
    }
    
    variables:
      filtered:
        fn::invoke:
          function: digitalocean:getDedicatedInferenceTokens
          arguments:
            dedicatedInferenceId: ${example.id}
            filters:
              - key: name
                values:
                  - my-token
    

    Using getDedicatedInferenceTokens

    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 getDedicatedInferenceTokens(args: GetDedicatedInferenceTokensArgs, opts?: InvokeOptions): Promise<GetDedicatedInferenceTokensResult>
    function getDedicatedInferenceTokensOutput(args: GetDedicatedInferenceTokensOutputArgs, opts?: InvokeOptions): Output<GetDedicatedInferenceTokensResult>
    def get_dedicated_inference_tokens(dedicated_inference_id: Optional[str] = None,
                                       filters: Optional[Sequence[GetDedicatedInferenceTokensFilter]] = None,
                                       sorts: Optional[Sequence[GetDedicatedInferenceTokensSort]] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetDedicatedInferenceTokensResult
    def get_dedicated_inference_tokens_output(dedicated_inference_id: Optional[pulumi.Input[str]] = None,
                                       filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDedicatedInferenceTokensFilterArgs]]]] = None,
                                       sorts: Optional[pulumi.Input[Sequence[pulumi.Input[GetDedicatedInferenceTokensSortArgs]]]] = None,
                                       opts: Optional[InvokeOptions] = None) -> Output[GetDedicatedInferenceTokensResult]
    func GetDedicatedInferenceTokens(ctx *Context, args *GetDedicatedInferenceTokensArgs, opts ...InvokeOption) (*GetDedicatedInferenceTokensResult, error)
    func GetDedicatedInferenceTokensOutput(ctx *Context, args *GetDedicatedInferenceTokensOutputArgs, opts ...InvokeOption) GetDedicatedInferenceTokensResultOutput

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

    public static class GetDedicatedInferenceTokens 
    {
        public static Task<GetDedicatedInferenceTokensResult> InvokeAsync(GetDedicatedInferenceTokensArgs args, InvokeOptions? opts = null)
        public static Output<GetDedicatedInferenceTokensResult> Invoke(GetDedicatedInferenceTokensInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDedicatedInferenceTokensResult> getDedicatedInferenceTokens(GetDedicatedInferenceTokensArgs args, InvokeOptions options)
    public static Output<GetDedicatedInferenceTokensResult> getDedicatedInferenceTokens(GetDedicatedInferenceTokensArgs args, InvokeOptions options)
    
    fn::invoke:
      function: digitalocean:index/getDedicatedInferenceTokens:getDedicatedInferenceTokens
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DedicatedInferenceId string
    The ID of the dedicated inference endpoint to list tokens for.
    Filters List<Pulumi.DigitalOcean.Inputs.GetDedicatedInferenceTokensFilter>
    Filter the results. The filter block is documented below.
    Sorts List<Pulumi.DigitalOcean.Inputs.GetDedicatedInferenceTokensSort>
    Sort the results. The sort block is documented below.
    DedicatedInferenceId string
    The ID of the dedicated inference endpoint to list tokens for.
    Filters []GetDedicatedInferenceTokensFilter
    Filter the results. The filter block is documented below.
    Sorts []GetDedicatedInferenceTokensSort
    Sort the results. The sort block is documented below.
    dedicatedInferenceId String
    The ID of the dedicated inference endpoint to list tokens for.
    filters List<GetDedicatedInferenceTokensFilter>
    Filter the results. The filter block is documented below.
    sorts List<GetDedicatedInferenceTokensSort>
    Sort the results. The sort block is documented below.
    dedicatedInferenceId string
    The ID of the dedicated inference endpoint to list tokens for.
    filters GetDedicatedInferenceTokensFilter[]
    Filter the results. The filter block is documented below.
    sorts GetDedicatedInferenceTokensSort[]
    Sort the results. The sort block is documented below.
    dedicated_inference_id str
    The ID of the dedicated inference endpoint to list tokens for.
    filters Sequence[GetDedicatedInferenceTokensFilter]
    Filter the results. The filter block is documented below.
    sorts Sequence[GetDedicatedInferenceTokensSort]
    Sort the results. The sort block is documented below.
    dedicatedInferenceId String
    The ID of the dedicated inference endpoint to list tokens for.
    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.

    getDedicatedInferenceTokens Result

    The following output properties are available:

    DedicatedInferenceId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Tokens []GetDedicatedInferenceTokensToken
    A list of tokens satisfying any filter and sort criteria. Each element contains:
    Filters []GetDedicatedInferenceTokensFilter
    Sorts []GetDedicatedInferenceTokensSort
    dedicatedInferenceId String
    id String
    The provider-assigned unique ID for this managed resource.
    tokens List<GetDedicatedInferenceTokensToken>
    A list of tokens satisfying any filter and sort criteria. Each element contains:
    filters List<GetDedicatedInferenceTokensFilter>
    sorts List<GetDedicatedInferenceTokensSort>
    dedicatedInferenceId string
    id string
    The provider-assigned unique ID for this managed resource.
    tokens GetDedicatedInferenceTokensToken[]
    A list of tokens satisfying any filter and sort criteria. Each element contains:
    filters GetDedicatedInferenceTokensFilter[]
    sorts GetDedicatedInferenceTokensSort[]
    dedicated_inference_id str
    id str
    The provider-assigned unique ID for this managed resource.
    tokens Sequence[GetDedicatedInferenceTokensToken]
    A list of tokens satisfying any filter and sort criteria. Each element contains:
    filters Sequence[GetDedicatedInferenceTokensFilter]
    sorts Sequence[GetDedicatedInferenceTokensSort]
    dedicatedInferenceId String
    id String
    The provider-assigned unique ID for this managed resource.
    tokens List<Property Map>
    A list of tokens satisfying any filter and sort criteria. Each element contains:
    filters List<Property Map>
    sorts List<Property Map>

    Supporting Types

    GetDedicatedInferenceTokensFilter

    Key string
    Filter the tokens by this key. This may be one of id, name, createdAt.
    Values List<string>
    A list of values to match against the key field.
    All bool
    Set to true to require that a field match all of the values instead of just one.
    MatchBy string
    One of exact (default), re, or substring.
    Key string
    Filter the tokens by this key. This may be one of id, name, createdAt.
    Values []string
    A list of values to match against the key field.
    All bool
    Set to true to require that a field match all of the values instead of just one.
    MatchBy string
    One of exact (default), re, or substring.
    key String
    Filter the tokens by this key. This may be one of id, name, createdAt.
    values List<String>
    A list of values to match against the key field.
    all Boolean
    Set to true to require that a field match all of the values instead of just one.
    matchBy String
    One of exact (default), re, or substring.
    key string
    Filter the tokens by this key. This may be one of id, name, createdAt.
    values string[]
    A list of values to match against the key field.
    all boolean
    Set to true to require that a field match all of the values instead of just one.
    matchBy string
    One of exact (default), re, or substring.
    key str
    Filter the tokens by this key. This may be one of id, name, createdAt.
    values Sequence[str]
    A list of values to match against the key field.
    all bool
    Set to true to require that a field match all of the values instead of just one.
    match_by str
    One of exact (default), re, or substring.
    key String
    Filter the tokens by this key. This may be one of id, name, createdAt.
    values List<String>
    A list of values to match against the key field.
    all Boolean
    Set to true to require that a field match all of the values instead of just one.
    matchBy String
    One of exact (default), re, or substring.

    GetDedicatedInferenceTokensSort

    Key string
    Sort the tokens by this key. This may be one of the keys listed in filter.
    Direction string
    The sort direction. This may be either asc or desc.
    Key string
    Sort the tokens by this key. This may be one of the keys listed in filter.
    Direction string
    The sort direction. This may be either asc or desc.
    key String
    Sort the tokens by this key. This may be one of the keys listed in filter.
    direction String
    The sort direction. This may be either asc or desc.
    key string
    Sort the tokens by this key. This may be one of the keys listed in filter.
    direction string
    The sort direction. This may be either asc or desc.
    key str
    Sort the tokens by this key. This may be one of the keys listed in filter.
    direction str
    The sort direction. This may be either asc or desc.
    key String
    Sort the tokens by this key. This may be one of the keys listed in filter.
    direction String
    The sort direction. This may be either asc or desc.

    GetDedicatedInferenceTokensToken

    CreatedAt string
    The date and time when the token was created.
    Id string
    The unique ID of the token.
    Name string
    The name of the token.
    CreatedAt string
    The date and time when the token was created.
    Id string
    The unique ID of the token.
    Name string
    The name of the token.
    createdAt String
    The date and time when the token was created.
    id String
    The unique ID of the token.
    name String
    The name of the token.
    createdAt string
    The date and time when the token was created.
    id string
    The unique ID of the token.
    name string
    The name of the token.
    created_at str
    The date and time when the token was created.
    id str
    The unique ID of the token.
    name str
    The name of the token.
    createdAt String
    The date and time when the token was created.
    id String
    The unique ID of the token.
    name String
    The name of the token.

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    Viewing docs for DigitalOcean v4.65.0
    published on Wednesday, Apr 29, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.