DanubeData v0.1.7 published on Sunday, Feb 1, 2026 by AdrianSilaghi
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 dictionarygetCaches Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
List<Danube
Data. Danube Data. Outputs. Get Caches Instance> - List of cache instances. Each instance contains:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]Get
Caches Instance - List of cache instances. Each instance contains:
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<Get
Caches Instance> - List of cache instances. Each instance contains:
- id string
- The provider-assigned unique ID for this managed resource.
- instances
Get
Caches Instance[] - List of cache instances. Each instance contains:
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[Get
Caches Instance] - 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
- Cache
Provider string - Cache provider (Redis, Valkey, Dragonfly).
- Cpu
Cores int - Number of CPU cores.
- Created
At string - Timestamp when the instance was created.
- Datacenter string
- Datacenter location.
- Endpoint string
- Connection endpoint hostname.
- Id string
- Unique identifier for the cache instance.
- Memory
Size intMb - Memory size in MB.
- Monthly
Cost double - Estimated monthly cost.
- Name string
- Name of the cache instance.
- Port int
- Connection port.
- Resource
Profile string - Resource profile (predefined CPU/RAM configuration).
- Status string
- Current status (creating, running, stopped, error).
- Version string
- Cache version.
- Cache
Provider string - Cache provider (Redis, Valkey, Dragonfly).
- Cpu
Cores int - Number of CPU cores.
- Created
At string - Timestamp when the instance was created.
- Datacenter string
- Datacenter location.
- Endpoint string
- Connection endpoint hostname.
- Id string
- Unique identifier for the cache instance.
- Memory
Size intMb - Memory size in MB.
- Monthly
Cost float64 - Estimated monthly cost.
- Name string
- Name of the cache instance.
- Port int
- Connection port.
- Resource
Profile string - Resource profile (predefined CPU/RAM configuration).
- Status string
- Current status (creating, running, stopped, error).
- Version string
- Cache version.
- cache
Provider String - Cache provider (Redis, Valkey, Dragonfly).
- cpu
Cores Integer - Number of CPU cores.
- created
At String - Timestamp when the instance was created.
- datacenter String
- Datacenter location.
- endpoint String
- Connection endpoint hostname.
- id String
- Unique identifier for the cache instance.
- memory
Size IntegerMb - Memory size in MB.
- monthly
Cost Double - Estimated monthly cost.
- name String
- Name of the cache instance.
- port Integer
- Connection port.
- resource
Profile String - Resource profile (predefined CPU/RAM configuration).
- status String
- Current status (creating, running, stopped, error).
- version String
- Cache version.
- cache
Provider string - Cache provider (Redis, Valkey, Dragonfly).
- cpu
Cores number - Number of CPU cores.
- created
At string - Timestamp when the instance was created.
- datacenter string
- Datacenter location.
- endpoint string
- Connection endpoint hostname.
- id string
- Unique identifier for the cache instance.
- memory
Size numberMb - Memory size in MB.
- monthly
Cost number - Estimated monthly cost.
- name string
- Name of the cache instance.
- port number
- Connection port.
- resource
Profile 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_ intmb - 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.
- cache
Provider String - Cache provider (Redis, Valkey, Dragonfly).
- cpu
Cores Number - Number of CPU cores.
- created
At String - Timestamp when the instance was created.
- datacenter String
- Datacenter location.
- endpoint String
- Connection endpoint hostname.
- id String
- Unique identifier for the cache instance.
- memory
Size NumberMb - Memory size in MB.
- monthly
Cost Number - Estimated monthly cost.
- name String
- Name of the cache instance.
- port Number
- Connection port.
- resource
Profile 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
danubedataTerraform Provider.
DanubeData v0.1.7 published on Sunday, Feb 1, 2026 by AdrianSilaghi
