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.getDatabases
Lists all database instances in your account.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as danubedata from "@pulumi/danubedata";
const all = danubedata.getDatabases({});
export const databaseCount = all.then(all => all.instances).length;
export const databaseEndpoints = all.then(all => .reduce((__obj, db) => ({ ...__obj, [db.name]: db.endpoint })));
import pulumi
import pulumi_danubedata as danubedata
all = danubedata.get_databases()
pulumi.export("databaseCount", len(all.instances))
pulumi.export("databaseEndpoints", {db.name: db.endpoint for db in all.instances})
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.GetDatabases(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
ctx.Export("databaseCount", pulumi.Int(len(all.Instances)))
ctx.Export("databaseEndpoints", 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.GetDatabases.Invoke();
return new Dictionary<string, object?>
{
["databaseCount"] = all.Apply(getDatabasesResult => getDatabasesResult.Instances).Length,
["databaseEndpoints"] = .ToDictionary(item => {
var db = item.Value;
return db.Name;
}, item => {
var db = item.Value;
return db.Endpoint;
}),
};
});
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.getDatabases();
ctx.export("databaseCount", all.applyValue(getDatabasesResult -> getDatabasesResult.instances()).length());
ctx.export("databaseEndpoints", "TODO: ForExpression");
}
}
Example coming soon!
Find Database by Name
import * as pulumi from "@pulumi/pulumi";
import * as danubedata from "@pulumi/danubedata";
const all = danubedata.getDatabases({});
const productionDb = all.then(all => .filter(db => db.name == "production-db").map(db => (db))[0]);
export const productionConnection = `${productionDb.engine}://${productionDb.username}@${productionDb.endpoint}:${productionDb.port}/${productionDb.databaseName}`;
import pulumi
import pulumi_danubedata as danubedata
all = danubedata.get_databases()
production_db = [db for db in all.instances if db.name == "production-db"][0]
pulumi.export("productionConnection", f"{production_db.engine}://{production_db.username}@{production_db.endpoint}:{production_db.port}/{production_db.database_name}")
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.GetDatabases(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
productionDb := "TODO: For expression"[0]
ctx.Export("productionConnection", pulumi.Sprintf("%v://%v@%v:%v/%v", productionDb.Engine, productionDb.Username, productionDb.Endpoint, productionDb.Port, productionDb.DatabaseName))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DanubeData = Pulumi.DanubeData;
return await Deployment.RunAsync(() =>
{
var all = DanubeData.GetDatabases.Invoke();
var productionDb = .Where(db => db.Name == "production-db").Select(db =>
{
return db;
}).ToList()[0];
return new Dictionary<string, object?>
{
["productionConnection"] = $"{productionDb.Engine}://{productionDb.Username}@{productionDb.Endpoint}:{productionDb.Port}/{productionDb.DatabaseName}",
};
});
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.getDatabases();
final var productionDb = "TODO: ForExpression"[0];
ctx.export("productionConnection", String.format("%s://%s@%s:%s/%s", productionDb.engine(),productionDb.username(),productionDb.endpoint(),productionDb.port(),productionDb.databaseName()));
}
}
Example coming soon!
Filter by Engine
import * as pulumi from "@pulumi/pulumi";
import * as danubedata from "@pulumi/danubedata";
const all = danubedata.getDatabases({});
const postgresDbs = all.then(all => .filter(db => db.engine == "PostgreSQL").map(db => (db)));
const mysqlDbs = all.then(all => .filter(db => db.engine == "MySQL").map(db => (db)));
export const postgresCount = postgresDbs.length;
import pulumi
import pulumi_danubedata as danubedata
all = danubedata.get_databases()
postgres_dbs = [db for db in all.instances if db.engine == "PostgreSQL"]
mysql_dbs = [db for db in all.instances if db.engine == "MySQL"]
pulumi.export("postgresCount", len(postgres_dbs))
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.GetDatabases(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
postgresDbs := "TODO: For expression"
_ := "TODO: For expression"
ctx.Export("postgresCount", pulumi.Int(len(postgresDbs)))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DanubeData = Pulumi.DanubeData;
return await Deployment.RunAsync(() =>
{
var all = DanubeData.GetDatabases.Invoke();
var postgresDbs = .Where(db => db.Engine == "PostgreSQL").Select(db =>
{
return db;
}).ToList();
var mysqlDbs = .Where(db => db.Engine == "MySQL").Select(db =>
{
return db;
}).ToList();
return new Dictionary<string, object?>
{
["postgresCount"] = postgresDbs.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.getDatabases();
final var postgresDbs = "TODO: ForExpression";
final var mysqlDbs = "TODO: ForExpression";
ctx.export("postgresCount", postgresDbs.length());
}
}
Example coming soon!
Using getDatabases
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 getDatabases(opts?: InvokeOptions): Promise<GetDatabasesResult>
function getDatabasesOutput(opts?: InvokeOptions): Output<GetDatabasesResult>def get_databases(opts: Optional[InvokeOptions] = None) -> GetDatabasesResult
def get_databases_output(opts: Optional[InvokeOptions] = None) -> Output[GetDatabasesResult]func GetDatabases(ctx *Context, opts ...InvokeOption) (*GetDatabasesResult, error)
func GetDatabasesOutput(ctx *Context, opts ...InvokeOption) GetDatabasesResultOutput> Note: This function is named GetDatabases in the Go SDK.
public static class GetDatabases
{
public static Task<GetDatabasesResult> InvokeAsync(InvokeOptions? opts = null)
public static Output<GetDatabasesResult> Invoke(InvokeOptions? opts = null)
}public static CompletableFuture<GetDatabasesResult> getDatabases(InvokeOptions options)
public static Output<GetDatabasesResult> getDatabases(InvokeOptions options)
fn::invoke:
function: danubedata:index/getDatabases:getDatabases
arguments:
# arguments dictionarygetDatabases 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 Databases Instance> - List of database instances. Each instance contains:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]Get
Databases Instance - List of database instances. Each instance contains:
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<Get
Databases Instance> - List of database instances. Each instance contains:
- id string
- The provider-assigned unique ID for this managed resource.
- instances
Get
Databases Instance[] - List of database instances. Each instance contains:
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[Get
Databases Instance] - List of database instances. Each instance contains:
- id String
- The provider-assigned unique ID for this managed resource.
- instances List<Property Map>
- List of database instances. Each instance contains:
Supporting Types
GetDatabasesInstance
- Cpu
Cores int - Number of CPU cores.
- Created
At string - Timestamp when the instance was created.
- Database
Name string - Name of the database.
- Datacenter string
- Datacenter location.
- Endpoint string
- Connection endpoint hostname.
- Engine string
- Database engine (MySQL, PostgreSQL, MariaDB).
- Id string
- Unique identifier for the database instance.
- Memory
Size intMb - Memory size in MB.
- Monthly
Cost double - Estimated monthly cost.
- Name string
- Name of the database instance.
- Port int
- Connection port.
- Resource
Profile string - Resource profile (predefined CPU/RAM/Storage configuration).
- Status string
- Current status (creating, running, stopped, error).
- Storage
Size intGb - Storage size in GB.
- Username string
- Database admin username.
- Version string
- Database version.
- Cpu
Cores int - Number of CPU cores.
- Created
At string - Timestamp when the instance was created.
- Database
Name string - Name of the database.
- Datacenter string
- Datacenter location.
- Endpoint string
- Connection endpoint hostname.
- Engine string
- Database engine (MySQL, PostgreSQL, MariaDB).
- Id string
- Unique identifier for the database instance.
- Memory
Size intMb - Memory size in MB.
- Monthly
Cost float64 - Estimated monthly cost.
- Name string
- Name of the database instance.
- Port int
- Connection port.
- Resource
Profile string - Resource profile (predefined CPU/RAM/Storage configuration).
- Status string
- Current status (creating, running, stopped, error).
- Storage
Size intGb - Storage size in GB.
- Username string
- Database admin username.
- Version string
- Database version.
- cpu
Cores Integer - Number of CPU cores.
- created
At String - Timestamp when the instance was created.
- database
Name String - Name of the database.
- datacenter String
- Datacenter location.
- endpoint String
- Connection endpoint hostname.
- engine String
- Database engine (MySQL, PostgreSQL, MariaDB).
- id String
- Unique identifier for the database instance.
- memory
Size IntegerMb - Memory size in MB.
- monthly
Cost Double - Estimated monthly cost.
- name String
- Name of the database instance.
- port Integer
- Connection port.
- resource
Profile String - Resource profile (predefined CPU/RAM/Storage configuration).
- status String
- Current status (creating, running, stopped, error).
- storage
Size IntegerGb - Storage size in GB.
- username String
- Database admin username.
- version String
- Database version.
- cpu
Cores number - Number of CPU cores.
- created
At string - Timestamp when the instance was created.
- database
Name string - Name of the database.
- datacenter string
- Datacenter location.
- endpoint string
- Connection endpoint hostname.
- engine string
- Database engine (MySQL, PostgreSQL, MariaDB).
- id string
- Unique identifier for the database instance.
- memory
Size numberMb - Memory size in MB.
- monthly
Cost number - Estimated monthly cost.
- name string
- Name of the database instance.
- port number
- Connection port.
- resource
Profile string - Resource profile (predefined CPU/RAM/Storage configuration).
- status string
- Current status (creating, running, stopped, error).
- storage
Size numberGb - Storage size in GB.
- username string
- Database admin username.
- version string
- Database version.
- cpu_
cores int - Number of CPU cores.
- created_
at str - Timestamp when the instance was created.
- database_
name str - Name of the database.
- datacenter str
- Datacenter location.
- endpoint str
- Connection endpoint hostname.
- engine str
- Database engine (MySQL, PostgreSQL, MariaDB).
- id str
- Unique identifier for the database instance.
- memory_
size_ intmb - Memory size in MB.
- monthly_
cost float - Estimated monthly cost.
- name str
- Name of the database instance.
- port int
- Connection port.
- resource_
profile str - Resource profile (predefined CPU/RAM/Storage configuration).
- status str
- Current status (creating, running, stopped, error).
- storage_
size_ intgb - Storage size in GB.
- username str
- Database admin username.
- version str
- Database version.
- cpu
Cores Number - Number of CPU cores.
- created
At String - Timestamp when the instance was created.
- database
Name String - Name of the database.
- datacenter String
- Datacenter location.
- endpoint String
- Connection endpoint hostname.
- engine String
- Database engine (MySQL, PostgreSQL, MariaDB).
- id String
- Unique identifier for the database instance.
- memory
Size NumberMb - Memory size in MB.
- monthly
Cost Number - Estimated monthly cost.
- name String
- Name of the database instance.
- port Number
- Connection port.
- resource
Profile String - Resource profile (predefined CPU/RAM/Storage configuration).
- status String
- Current status (creating, running, stopped, error).
- storage
Size NumberGb - Storage size in GB.
- username String
- Database admin username.
- version String
- Database 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
