1. Packages
  2. Civo Provider
  3. API Docs
  4. getDatabase
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

civo.getDatabase

Explore with Pulumi AI

civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

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",
});
Copy
import pulumi
import pulumi_civo as civo

test = civo.get_database(name="test-database",
    region="LON1")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: civo:getDatabase
      arguments:
        name: test-database
        region: LON1
Copy

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>
Copy
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]
Copy
func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)
func LookupDatabaseOutput(ctx *Context, args *LookupDatabaseOutputArgs, opts ...InvokeOption) LookupDatabaseResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
public static Output<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: civo:index/getDatabase:getDatabase
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id string
The ID of the Database
Name string
The name of the Database
Region string
The region of an existing Database
Id string
The ID of the Database
Name string
The name of the Database
Region string
The region of an existing Database
id String
The ID of the Database
name String
The name of the Database
region String
The region of an existing Database
id string
The ID of the Database
name string
The name of the Database
region string
The region of an existing Database
id str
The ID of the Database
name str
The name of the Database
region str
The region of an existing Database
id String
The ID of the Database
name String
The name of the Database
region String
The region of an existing Database

getDatabase Result

The following output properties are available:

DnsEndpoint string
The DNS endpoint of the database
Endpoint string
The endpoint of the database
Engine string
The engine of the database
FirewallId string
The firewall id of the Database
NetworkId 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
DnsEndpoint string
The DNS endpoint of the database
Endpoint string
The endpoint of the database
Engine string
The engine of the database
FirewallId string
The firewall id of the Database
NetworkId 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
dnsEndpoint String
The DNS endpoint of the database
endpoint String
The endpoint of the database
engine String
The engine of the database
firewallId String
The firewall id of the Database
networkId 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
dnsEndpoint string
The DNS endpoint of the database
endpoint string
The endpoint of the database
engine string
The engine of the database
firewallId string
The firewall id of the Database
networkId 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
dnsEndpoint String
The DNS endpoint of the database
endpoint String
The endpoint of the database
engine String
The engine of the database
firewallId String
The firewall id of the Database
networkId 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 civo Terraform Provider.
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo