civo 1.1.7 published on Sunday, Sep 14, 2025 by civo
civo.getDatabase
Start a Neo task
Explain and create a civo.getDatabase resource
Get information of an Database for use in other resources. This data source provides all of the Database’s properties as configured on your Civo account.
Note: This data source returns a single Database. When specifying a name, an error will be raised if more than one Databases with the same name found.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
const test = civo.getDatabase({
name: "test-database",
region: "LON1",
});
import pulumi
import pulumi_civo as civo
test = civo.get_database(name="test-database",
region="LON1")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/civo/civo"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := civo.LookupDatabase(ctx, &civo.LookupDatabaseArgs{
Name: pulumi.StringRef("test-database"),
Region: pulumi.StringRef("LON1"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() =>
{
var test = Civo.GetDatabase.Invoke(new()
{
Name = "test-database",
Region = "LON1",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetDatabaseArgs;
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 test = CivoFunctions.getDatabase(GetDatabaseArgs.builder()
.name("test-database")
.region("LON1")
.build());
}
}
variables:
test:
fn::invoke:
function: civo:getDatabase
arguments:
name: test-database
region: LON1
Using getDatabase
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 getDatabase(args: GetDatabaseArgs, opts?: InvokeOptions): Promise<GetDatabaseResult>
function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: InvokeOptions): Output<GetDatabaseResult>def get_database(id: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
def get_database_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseResult]func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)
func LookupDatabaseOutput(ctx *Context, args *LookupDatabaseOutputArgs, opts ...InvokeOption) LookupDatabaseResultOutput> Note: This function is named LookupDatabase in the Go SDK.
public static class GetDatabase
{
public static Task<GetDatabaseResult> InvokeAsync(GetDatabaseArgs args, InvokeOptions? opts = null)
public static Output<GetDatabaseResult> Invoke(GetDatabaseInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
public static Output<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
fn::invoke:
function: civo:index/getDatabase:getDatabase
arguments:
# arguments dictionaryThe following arguments are supported:
getDatabase Result
The following output properties are available:
- Dns
Endpoint string - The DNS endpoint of the database
- Endpoint string
- The endpoint of the database
- Engine string
- The engine of the database
- Firewall
Id string - The firewall id of the Database
- Network
Id string - The network id of the Database
- Nodes double
- Count of nodes
- Password string
- The password of the database
- Port double
- The port of the database
- Region string
- The region of an existing Database
- Size string
- Size of the database
- Status string
- The status of the database
- Username string
- The username of the database
- Version string
- The version of the database
- Id string
- The ID of the Database
- Name string
- The name of the Database
- Dns
Endpoint string - The DNS endpoint of the database
- Endpoint string
- The endpoint of the database
- Engine string
- The engine of the database
- Firewall
Id string - The firewall id of the Database
- Network
Id string - The network id of the Database
- Nodes float64
- Count of nodes
- Password string
- The password of the database
- Port float64
- The port of the database
- Region string
- The region of an existing Database
- Size string
- Size of the database
- Status string
- The status of the database
- Username string
- The username of the database
- Version string
- The version of the database
- Id string
- The ID of the Database
- Name string
- The name of the Database
- dns
Endpoint String - The DNS endpoint of the database
- endpoint String
- The endpoint of the database
- engine String
- The engine of the database
- firewall
Id String - The firewall id of the Database
- network
Id String - The network id of the Database
- nodes Double
- Count of nodes
- password String
- The password of the database
- port Double
- The port of the database
- region String
- The region of an existing Database
- size String
- Size of the database
- status String
- The status of the database
- username String
- The username of the database
- version String
- The version of the database
- id String
- The ID of the Database
- name String
- The name of the Database
- dns
Endpoint string - The DNS endpoint of the database
- endpoint string
- The endpoint of the database
- engine string
- The engine of the database
- firewall
Id string - The firewall id of the Database
- network
Id string - The network id of the Database
- nodes number
- Count of nodes
- password string
- The password of the database
- port number
- The port of the database
- region string
- The region of an existing Database
- size string
- Size of the database
- status string
- The status of the database
- username string
- The username of the database
- version string
- The version of the database
- id string
- The ID of the Database
- name string
- The name of the Database
- dns_
endpoint str - The DNS endpoint of the database
- endpoint str
- The endpoint of the database
- engine str
- The engine of the database
- firewall_
id str - The firewall id of the Database
- network_
id str - The network id of the Database
- nodes float
- Count of nodes
- password str
- The password of the database
- port float
- The port of the database
- region str
- The region of an existing Database
- size str
- Size of the database
- status str
- The status of the database
- username str
- The username of the database
- version str
- The version of the database
- id str
- The ID of the Database
- name str
- The name of the Database
- dns
Endpoint String - The DNS endpoint of the database
- endpoint String
- The endpoint of the database
- engine String
- The engine of the database
- firewall
Id String - The firewall id of the Database
- network
Id String - The network id of the Database
- nodes Number
- Count of nodes
- password String
- The password of the database
- port Number
- The port of the database
- region String
- The region of an existing Database
- size String
- Size of the database
- status String
- The status of the database
- username String
- The username of the database
- version String
- The version of the database
- id String
- The ID of the Database
- name String
- The name of the Database
Package Details
- Repository
- Civo civo/terraform-provider-civo
- License
- Notes
- This Pulumi package is based on the
civoTerraform Provider.
