Viewing docs for OVHCloud v2.12.0
published on Thursday, Mar 12, 2026 by OVHcloud
published on Thursday, Mar 12, 2026 by OVHcloud
Viewing docs for OVHCloud v2.12.0
published on Thursday, Mar 12, 2026 by OVHcloud
published on Thursday, Mar 12, 2026 by OVHcloud
Use this data source to get information about a database of a database cluster associated with a public cloud project.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
const database = ovh.CloudProjectDatabase.getDatabaseInstance({
serviceName: "XXX",
engine: "YYY",
clusterId: "ZZZ",
name: "UUU",
});
export const databaseName = database.then(database => database.name);
import pulumi
import pulumi_ovh as ovh
database = ovh.CloudProjectDatabase.get_database_instance(service_name="XXX",
engine="YYY",
cluster_id="ZZZ",
name="UUU")
pulumi.export("databaseName", database.name)
package main
import (
"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/cloudprojectdatabase"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
database, err := cloudprojectdatabase.GetDatabaseInstance(ctx, &cloudprojectdatabase.GetDatabaseInstanceArgs{
ServiceName: "XXX",
Engine: "YYY",
ClusterId: "ZZZ",
Name: "UUU",
}, nil)
if err != nil {
return err
}
ctx.Export("databaseName", database.Name)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var database = Ovh.CloudProjectDatabase.GetDatabaseInstance.Invoke(new()
{
ServiceName = "XXX",
Engine = "YYY",
ClusterId = "ZZZ",
Name = "UUU",
});
return new Dictionary<string, object?>
{
["databaseName"] = database.Apply(getDatabaseInstanceResult => getDatabaseInstanceResult.Name),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.CloudProjectDatabase.CloudProjectDatabaseFunctions;
import com.pulumi.ovh.CloudProjectDatabase.inputs.GetDatabaseInstanceArgs;
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 database = CloudProjectDatabaseFunctions.getDatabaseInstance(GetDatabaseInstanceArgs.builder()
.serviceName("XXX")
.engine("YYY")
.clusterId("ZZZ")
.name("UUU")
.build());
ctx.export("databaseName", database.name());
}
}
variables:
database:
fn::invoke:
function: ovh:CloudProjectDatabase:getDatabaseInstance
arguments:
serviceName: XXX
engine: YYY
clusterId: ZZZ
name: UUU
outputs:
databaseName: ${database.name}
Using getDatabaseInstance
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 getDatabaseInstance(args: GetDatabaseInstanceArgs, opts?: InvokeOptions): Promise<GetDatabaseInstanceResult>
function getDatabaseInstanceOutput(args: GetDatabaseInstanceOutputArgs, opts?: InvokeOptions): Output<GetDatabaseInstanceResult>def get_database_instance(cluster_id: Optional[str] = None,
engine: Optional[str] = None,
name: Optional[str] = None,
service_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatabaseInstanceResult
def get_database_instance_output(cluster_id: Optional[pulumi.Input[str]] = None,
engine: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
service_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseInstanceResult]func LookupDatabaseInstance(ctx *Context, args *LookupDatabaseInstanceArgs, opts ...InvokeOption) (*LookupDatabaseInstanceResult, error)
func LookupDatabaseInstanceOutput(ctx *Context, args *LookupDatabaseInstanceOutputArgs, opts ...InvokeOption) LookupDatabaseInstanceResultOutput> Note: This function is named LookupDatabaseInstance in the Go SDK.
public static class GetDatabaseInstance
{
public static Task<GetDatabaseInstanceResult> InvokeAsync(GetDatabaseInstanceArgs args, InvokeOptions? opts = null)
public static Output<GetDatabaseInstanceResult> Invoke(GetDatabaseInstanceInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDatabaseInstanceResult> getDatabaseInstance(GetDatabaseInstanceArgs args, InvokeOptions options)
public static Output<GetDatabaseInstanceResult> getDatabaseInstance(GetDatabaseInstanceArgs args, InvokeOptions options)
fn::invoke:
function: ovh:CloudProjectDatabase/getDatabaseInstance:getDatabaseInstance
arguments:
# arguments dictionaryThe following arguments are supported:
- Cluster
Id string - Cluster ID
- Engine string
- The engine of the database cluster you want database information. To get a full list of available engine visit: public documentation. Available engines:
- Name string
- Name of the database.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- Cluster
Id string - Cluster ID
- Engine string
- The engine of the database cluster you want database information. To get a full list of available engine visit: public documentation. Available engines:
- Name string
- Name of the database.
- Service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- cluster
Id String - Cluster ID
- engine String
- The engine of the database cluster you want database information. To get a full list of available engine visit: public documentation. Available engines:
- name String
- Name of the database.
- service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- cluster
Id string - Cluster ID
- engine string
- The engine of the database cluster you want database information. To get a full list of available engine visit: public documentation. Available engines:
- name string
- Name of the database.
- service
Name string - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- cluster_
id str - Cluster ID
- engine str
- The engine of the database cluster you want database information. To get a full list of available engine visit: public documentation. Available engines:
- name str
- Name of the database.
- service_
name str - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- cluster
Id String - Cluster ID
- engine String
- The engine of the database cluster you want database information. To get a full list of available engine visit: public documentation. Available engines:
- name String
- Name of the database.
- service
Name String - The id of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
getDatabaseInstance Result
The following output properties are available:
- cluster
Id String - See Argument Reference above.
- default_ Boolean
- Defines if the database has been created by default.
- engine String
- See Argument Reference above.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the database.
- service
Name String - Current status of the database.
- cluster
Id string - See Argument Reference above.
- default boolean
- Defines if the database has been created by default.
- engine string
- See Argument Reference above.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Name of the database.
- service
Name string - Current status of the database.
- cluster_
id str - See Argument Reference above.
- default bool
- Defines if the database has been created by default.
- engine str
- See Argument Reference above.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Name of the database.
- service_
name str - Current status of the database.
- cluster
Id String - See Argument Reference above.
- default Boolean
- Defines if the database has been created by default.
- engine String
- See Argument Reference above.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the database.
- service
Name String - Current status of the database.
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovhTerraform Provider.
Viewing docs for OVHCloud v2.12.0
published on Thursday, Mar 12, 2026 by OVHcloud
published on Thursday, Mar 12, 2026 by OVHcloud
