1. Packages
  2. DanubeData
  3. API Docs
  4. getCaches
DanubeData v0.1.7 published on Sunday, Feb 1, 2026 by AdrianSilaghi
danubedata logo
DanubeData v0.1.7 published on Sunday, Feb 1, 2026 by AdrianSilaghi

    # danubedata.getCaches

    Lists all cache instances in your account.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as danubedata from "@pulumi/danubedata";
    
    const all = danubedata.getCaches({});
    export const cacheCount = all.then(all => all.instances).length;
    export const cacheEndpoints = all.then(all => .reduce((__obj, cache) => ({ ...__obj, [cache.name]: `${cache.endpoint}:${cache.port}` })));
    
    import pulumi
    import pulumi_danubedata as danubedata
    
    all = danubedata.get_caches()
    pulumi.export("cacheCount", len(all.instances))
    pulumi.export("cacheEndpoints", {cache.name: f"{cache.endpoint}:{cache.port}" for cache in all.instances})
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/AdrianSilaghi/pulumi-danubedata/sdk/go/danubedata"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := danubedata.GetCaches(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cacheCount", pulumi.Int(len(all.Instances)))
    		ctx.Export("cacheEndpoints", pulumi.StringMap("TODO: For expression"))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DanubeData = Pulumi.DanubeData;
    
    return await Deployment.RunAsync(() => 
    {
        var all = DanubeData.GetCaches.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["cacheCount"] = all.Apply(getCachesResult => getCachesResult.Instances).Length,
            ["cacheEndpoints"] = .ToDictionary(item => {
                var cache = item.Value;
                return cache.Name;
            }, item => {
                var cache = item.Value;
                return $"{cache.Endpoint}:{cache.Port}";
            }),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.danubedata.DanubedataFunctions;
    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 all = DanubedataFunctions.getCaches();
    
            ctx.export("cacheCount", all.applyValue(getCachesResult -> getCachesResult.instances()).length());
            ctx.export("cacheEndpoints", "TODO: ForExpression");
        }
    }
    
    Example coming soon!
    

    Find Cache by Name

    import * as pulumi from "@pulumi/pulumi";
    import * as danubedata from "@pulumi/danubedata";
    
    const all = danubedata.getCaches({});
    const mainCache = all.then(all => .filter(c => c.name == "main-cache").map(c => (c))[0]);
    export const redisUrl = `redis://${mainCache.endpoint}:${mainCache.port}`;
    
    import pulumi
    import pulumi_danubedata as danubedata
    
    all = danubedata.get_caches()
    main_cache = [c for c in all.instances if c.name == "main-cache"][0]
    pulumi.export("redisUrl", f"redis://{main_cache.endpoint}:{main_cache.port}")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/AdrianSilaghi/pulumi-danubedata/sdk/go/danubedata"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := danubedata.GetCaches(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		mainCache := "TODO: For expression"[0]
    		ctx.Export("redisUrl", pulumi.Sprintf("redis://%v:%v", mainCache.Endpoint, mainCache.Port))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DanubeData = Pulumi.DanubeData;
    
    return await Deployment.RunAsync(() => 
    {
        var all = DanubeData.GetCaches.Invoke();
    
        var mainCache = .Where(c => c.Name == "main-cache").Select(c => 
        {
            return c;
        }).ToList()[0];
    
        return new Dictionary<string, object?>
        {
            ["redisUrl"] = $"redis://{mainCache.Endpoint}:{mainCache.Port}",
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.danubedata.DanubedataFunctions;
    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 all = DanubedataFunctions.getCaches();
    
            final var mainCache = "TODO: ForExpression"[0];
    
            ctx.export("redisUrl", String.format("redis://%s:%s", mainCache.endpoint(),mainCache.port()));
        }
    }
    
    Example coming soon!
    

    Filter by Provider

    import * as pulumi from "@pulumi/pulumi";
    import * as danubedata from "@pulumi/danubedata";
    
    const all = danubedata.getCaches({});
    const redisCaches = all.then(all => .filter(c => c.cacheProvider == "Redis").map(c => (c)));
    const dragonflyCaches = all.then(all => .filter(c => c.cacheProvider == "Dragonfly").map(c => (c)));
    export const redisCount = redisCaches.length;
    
    import pulumi
    import pulumi_danubedata as danubedata
    
    all = danubedata.get_caches()
    redis_caches = [c for c in all.instances if c.cache_provider == "Redis"]
    dragonfly_caches = [c for c in all.instances if c.cache_provider == "Dragonfly"]
    pulumi.export("redisCount", len(redis_caches))
    
    package main
    
    import (
    	"github.com/AdrianSilaghi/pulumi-danubedata/sdk/go/danubedata"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := danubedata.GetCaches(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		redisCaches := "TODO: For expression"
    		_ := "TODO: For expression"
    		ctx.Export("redisCount", pulumi.Int(len(redisCaches)))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DanubeData = Pulumi.DanubeData;
    
    return await Deployment.RunAsync(() => 
    {
        var all = DanubeData.GetCaches.Invoke();
    
        var redisCaches = .Where(c => c.CacheProvider == "Redis").Select(c => 
        {
            return c;
        }).ToList();
    
        var dragonflyCaches = .Where(c => c.CacheProvider == "Dragonfly").Select(c => 
        {
            return c;
        }).ToList();
    
        return new Dictionary<string, object?>
        {
            ["redisCount"] = redisCaches.Length,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.danubedata.DanubedataFunctions;
    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 all = DanubedataFunctions.getCaches();
    
            final var redisCaches = "TODO: ForExpression";
    
            final var dragonflyCaches = "TODO: ForExpression";
    
            ctx.export("redisCount", redisCaches.length());
        }
    }
    
    Example coming soon!
    

    Using getCaches

    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 getCaches(opts?: InvokeOptions): Promise<GetCachesResult>
    function getCachesOutput(opts?: InvokeOptions): Output<GetCachesResult>
    def get_caches(opts: Optional[InvokeOptions] = None) -> GetCachesResult
    def get_caches_output(opts: Optional[InvokeOptions] = None) -> Output[GetCachesResult]
    func GetCaches(ctx *Context, opts ...InvokeOption) (*GetCachesResult, error)
    func GetCachesOutput(ctx *Context, opts ...InvokeOption) GetCachesResultOutput

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

    public static class GetCaches 
    {
        public static Task<GetCachesResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetCachesResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCachesResult> getCaches(InvokeOptions options)
    public static Output<GetCachesResult> getCaches(InvokeOptions options)
    
    fn::invoke:
      function: danubedata:index/getCaches:getCaches
      arguments:
        # arguments dictionary

    getCaches Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Instances List<DanubeData.DanubeData.Outputs.GetCachesInstance>
    List of cache instances. Each instance contains:
    Id string
    The provider-assigned unique ID for this managed resource.
    Instances []GetCachesInstance
    List of cache instances. Each instance contains:
    id String
    The provider-assigned unique ID for this managed resource.
    instances List<GetCachesInstance>
    List of cache instances. Each instance contains:
    id string
    The provider-assigned unique ID for this managed resource.
    instances GetCachesInstance[]
    List of cache instances. Each instance contains:
    id str
    The provider-assigned unique ID for this managed resource.
    instances Sequence[GetCachesInstance]
    List of cache instances. Each instance contains:
    id String
    The provider-assigned unique ID for this managed resource.
    instances List<Property Map>
    List of cache instances. Each instance contains:

    Supporting Types

    GetCachesInstance

    CacheProvider string
    Cache provider (Redis, Valkey, Dragonfly).
    CpuCores int
    Number of CPU cores.
    CreatedAt string
    Timestamp when the instance was created.
    Datacenter string
    Datacenter location.
    Endpoint string
    Connection endpoint hostname.
    Id string
    Unique identifier for the cache instance.
    MemorySizeMb int
    Memory size in MB.
    MonthlyCost double
    Estimated monthly cost.
    Name string
    Name of the cache instance.
    Port int
    Connection port.
    ResourceProfile string
    Resource profile (predefined CPU/RAM configuration).
    Status string
    Current status (creating, running, stopped, error).
    Version string
    Cache version.
    CacheProvider string
    Cache provider (Redis, Valkey, Dragonfly).
    CpuCores int
    Number of CPU cores.
    CreatedAt string
    Timestamp when the instance was created.
    Datacenter string
    Datacenter location.
    Endpoint string
    Connection endpoint hostname.
    Id string
    Unique identifier for the cache instance.
    MemorySizeMb int
    Memory size in MB.
    MonthlyCost float64
    Estimated monthly cost.
    Name string
    Name of the cache instance.
    Port int
    Connection port.
    ResourceProfile string
    Resource profile (predefined CPU/RAM configuration).
    Status string
    Current status (creating, running, stopped, error).
    Version string
    Cache version.
    cacheProvider String
    Cache provider (Redis, Valkey, Dragonfly).
    cpuCores Integer
    Number of CPU cores.
    createdAt String
    Timestamp when the instance was created.
    datacenter String
    Datacenter location.
    endpoint String
    Connection endpoint hostname.
    id String
    Unique identifier for the cache instance.
    memorySizeMb Integer
    Memory size in MB.
    monthlyCost Double
    Estimated monthly cost.
    name String
    Name of the cache instance.
    port Integer
    Connection port.
    resourceProfile String
    Resource profile (predefined CPU/RAM configuration).
    status String
    Current status (creating, running, stopped, error).
    version String
    Cache version.
    cacheProvider string
    Cache provider (Redis, Valkey, Dragonfly).
    cpuCores number
    Number of CPU cores.
    createdAt string
    Timestamp when the instance was created.
    datacenter string
    Datacenter location.
    endpoint string
    Connection endpoint hostname.
    id string
    Unique identifier for the cache instance.
    memorySizeMb number
    Memory size in MB.
    monthlyCost number
    Estimated monthly cost.
    name string
    Name of the cache instance.
    port number
    Connection port.
    resourceProfile string
    Resource profile (predefined CPU/RAM configuration).
    status string
    Current status (creating, running, stopped, error).
    version string
    Cache version.
    cache_provider str
    Cache provider (Redis, Valkey, Dragonfly).
    cpu_cores int
    Number of CPU cores.
    created_at str
    Timestamp when the instance was created.
    datacenter str
    Datacenter location.
    endpoint str
    Connection endpoint hostname.
    id str
    Unique identifier for the cache instance.
    memory_size_mb int
    Memory size in MB.
    monthly_cost float
    Estimated monthly cost.
    name str
    Name of the cache instance.
    port int
    Connection port.
    resource_profile str
    Resource profile (predefined CPU/RAM configuration).
    status str
    Current status (creating, running, stopped, error).
    version str
    Cache version.
    cacheProvider String
    Cache provider (Redis, Valkey, Dragonfly).
    cpuCores Number
    Number of CPU cores.
    createdAt String
    Timestamp when the instance was created.
    datacenter String
    Datacenter location.
    endpoint String
    Connection endpoint hostname.
    id String
    Unique identifier for the cache instance.
    memorySizeMb Number
    Memory size in MB.
    monthlyCost Number
    Estimated monthly cost.
    name String
    Name of the cache instance.
    port Number
    Connection port.
    resourceProfile String
    Resource profile (predefined CPU/RAM configuration).
    status String
    Current status (creating, running, stopped, error).
    version String
    Cache version.

    Package Details

    Repository
    danubedata AdrianSilaghi/pulumi-danubedata
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the danubedata Terraform Provider.
    danubedata logo
    DanubeData v0.1.7 published on Sunday, Feb 1, 2026 by AdrianSilaghi
      Meet Neo: Your AI Platform Teammate