1. Packages
  2. OVH
  3. API Docs
  4. CloudProjectDatabase
  5. getDatabase
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

ovh.CloudProjectDatabase.getDatabase

Explore with Pulumi AI

OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

Use this data source to get the managed database of a public cloud project.

Example Usage

To get information of a database cluster service:

import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";

const db = ovh.CloudProjectDatabase.getDatabase({
    serviceName: "XXXXXX",
    engine: "YYYY",
    id: "ZZZZ",
});
export const clusterId = db.then(db => db.id);
Copy
import pulumi
import pulumi_ovh as ovh

db = ovh.CloudProjectDatabase.get_database(service_name="XXXXXX",
    engine="YYYY",
    id="ZZZZ")
pulumi.export("clusterId", db.id)
Copy
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 {
		db, err := cloudprojectdatabase.GetDatabase(ctx, &cloudprojectdatabase.GetDatabaseArgs{
			ServiceName: "XXXXXX",
			Engine:      "YYYY",
			Id:          "ZZZZ",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("clusterId", db.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var db = Ovh.CloudProjectDatabase.GetDatabase.Invoke(new()
    {
        ServiceName = "XXXXXX",
        Engine = "YYYY",
        Id = "ZZZZ",
    });

    return new Dictionary<string, object?>
    {
        ["clusterId"] = db.Apply(getDatabaseResult => getDatabaseResult.Id),
    };
});
Copy
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.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 db = CloudProjectDatabaseFunctions.getDatabase(GetDatabaseArgs.builder()
            .serviceName("XXXXXX")
            .engine("YYYY")
            .id("ZZZZ")
            .build());

        ctx.export("clusterId", db.id());
    }
}
Copy
variables:
  db:
    fn::invoke:
      function: ovh:CloudProjectDatabase:getDatabase
      arguments:
        serviceName: XXXXXX
        engine: YYYY
        id: ZZZZ
outputs:
  clusterId: ${db.id}
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(engine: Optional[str] = None,
                 id: Optional[str] = None,
                 service_name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
def get_database_output(engine: Optional[pulumi.Input[str]] = None,
                 id: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseResult]
Copy
func GetDatabase(ctx *Context, args *GetDatabaseArgs, opts ...InvokeOption) (*GetDatabaseResult, error)
func GetDatabaseOutput(ctx *Context, args *GetDatabaseOutputArgs, opts ...InvokeOption) GetDatabaseResultOutput
Copy

> Note: This function is named GetDatabase 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: ovh:CloudProjectDatabase/getDatabase:getDatabase
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Engine This property is required. string
The database engine you want to get information. To get a full list of available engine visit: public documentation.
Id This property is required. string
Cluster ID
ServiceName This property is required. string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
Engine This property is required. string
The database engine you want to get information. To get a full list of available engine visit: public documentation.
Id This property is required. string
Cluster ID
ServiceName This property is required. string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
engine This property is required. String
The database engine you want to get information. To get a full list of available engine visit: public documentation.
id This property is required. String
Cluster ID
serviceName This property is required. String
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
engine This property is required. string
The database engine you want to get information. To get a full list of available engine visit: public documentation.
id This property is required. string
Cluster ID
serviceName This property is required. string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
engine This property is required. str
The database engine you want to get information. To get a full list of available engine visit: public documentation.
id This property is required. str
Cluster ID
service_name This property is required. str
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
engine This property is required. String
The database engine you want to get information. To get a full list of available engine visit: public documentation.
id This property is required. String
Cluster ID
serviceName This property is required. String
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

getDatabase Result

The following output properties are available:

AdvancedConfiguration Dictionary<string, string>
Advanced configuration key / value.
BackupRegions List<string>
List of region where backups are pushed.
BackupTime string
Time on which backups start every day.
CreatedAt string
Date of the creation of the cluster.
Description string
Description of the IP restriction
DiskSize int
The disk size (in GB) of the database service.
DiskType string
The disk type of the database service.
Endpoints List<GetDatabaseEndpoint>
List of all endpoints objects of the service.
Engine string
See Argument Reference above.
Flavor string
A valid OVHcloud public cloud database flavor name in which the nodes will be started.
Id string
See Argument Reference above.
IpRestrictions List<GetDatabaseIpRestriction>
IP Blocks authorized to access to the cluster.
KafkaRestApi bool
Defines whether the REST API is enabled on a kafka cluster.
KafkaSchemaRegistry bool
Defines whether the schema registry is enabled on a Kafka cluster
MaintenanceTime string
Time on which maintenances can start every day.
NetworkType string
Type of network of the cluster.
Nodes List<GetDatabaseNode>
List of nodes object.
OpensearchAclsEnabled bool
Plan string
Plan of the cluster.
ServiceName string
See Argument Reference above.
Status string
Current status of the cluster.
Version string
The version of the engine in which the service should be deployed
AdvancedConfiguration map[string]string
Advanced configuration key / value.
BackupRegions []string
List of region where backups are pushed.
BackupTime string
Time on which backups start every day.
CreatedAt string
Date of the creation of the cluster.
Description string
Description of the IP restriction
DiskSize int
The disk size (in GB) of the database service.
DiskType string
The disk type of the database service.
Endpoints []GetDatabaseEndpoint
List of all endpoints objects of the service.
Engine string
See Argument Reference above.
Flavor string
A valid OVHcloud public cloud database flavor name in which the nodes will be started.
Id string
See Argument Reference above.
IpRestrictions []GetDatabaseIpRestriction
IP Blocks authorized to access to the cluster.
KafkaRestApi bool
Defines whether the REST API is enabled on a kafka cluster.
KafkaSchemaRegistry bool
Defines whether the schema registry is enabled on a Kafka cluster
MaintenanceTime string
Time on which maintenances can start every day.
NetworkType string
Type of network of the cluster.
Nodes []GetDatabaseNode
List of nodes object.
OpensearchAclsEnabled bool
Plan string
Plan of the cluster.
ServiceName string
See Argument Reference above.
Status string
Current status of the cluster.
Version string
The version of the engine in which the service should be deployed
advancedConfiguration Map<String,String>
Advanced configuration key / value.
backupRegions List<String>
List of region where backups are pushed.
backupTime String
Time on which backups start every day.
createdAt String
Date of the creation of the cluster.
description String
Description of the IP restriction
diskSize Integer
The disk size (in GB) of the database service.
diskType String
The disk type of the database service.
endpoints List<GetDatabaseEndpoint>
List of all endpoints objects of the service.
engine String
See Argument Reference above.
flavor String
A valid OVHcloud public cloud database flavor name in which the nodes will be started.
id String
See Argument Reference above.
ipRestrictions List<GetDatabaseIpRestriction>
IP Blocks authorized to access to the cluster.
kafkaRestApi Boolean
Defines whether the REST API is enabled on a kafka cluster.
kafkaSchemaRegistry Boolean
Defines whether the schema registry is enabled on a Kafka cluster
maintenanceTime String
Time on which maintenances can start every day.
networkType String
Type of network of the cluster.
nodes List<GetDatabaseNode>
List of nodes object.
opensearchAclsEnabled Boolean
plan String
Plan of the cluster.
serviceName String
See Argument Reference above.
status String
Current status of the cluster.
version String
The version of the engine in which the service should be deployed
advancedConfiguration {[key: string]: string}
Advanced configuration key / value.
backupRegions string[]
List of region where backups are pushed.
backupTime string
Time on which backups start every day.
createdAt string
Date of the creation of the cluster.
description string
Description of the IP restriction
diskSize number
The disk size (in GB) of the database service.
diskType string
The disk type of the database service.
endpoints GetDatabaseEndpoint[]
List of all endpoints objects of the service.
engine string
See Argument Reference above.
flavor string
A valid OVHcloud public cloud database flavor name in which the nodes will be started.
id string
See Argument Reference above.
ipRestrictions GetDatabaseIpRestriction[]
IP Blocks authorized to access to the cluster.
kafkaRestApi boolean
Defines whether the REST API is enabled on a kafka cluster.
kafkaSchemaRegistry boolean
Defines whether the schema registry is enabled on a Kafka cluster
maintenanceTime string
Time on which maintenances can start every day.
networkType string
Type of network of the cluster.
nodes GetDatabaseNode[]
List of nodes object.
opensearchAclsEnabled boolean
plan string
Plan of the cluster.
serviceName string
See Argument Reference above.
status string
Current status of the cluster.
version string
The version of the engine in which the service should be deployed
advanced_configuration Mapping[str, str]
Advanced configuration key / value.
backup_regions Sequence[str]
List of region where backups are pushed.
backup_time str
Time on which backups start every day.
created_at str
Date of the creation of the cluster.
description str
Description of the IP restriction
disk_size int
The disk size (in GB) of the database service.
disk_type str
The disk type of the database service.
endpoints Sequence[cloudprojectdatabase.GetDatabaseEndpoint]
List of all endpoints objects of the service.
engine str
See Argument Reference above.
flavor str
A valid OVHcloud public cloud database flavor name in which the nodes will be started.
id str
See Argument Reference above.
ip_restrictions Sequence[cloudprojectdatabase.GetDatabaseIpRestriction]
IP Blocks authorized to access to the cluster.
kafka_rest_api bool
Defines whether the REST API is enabled on a kafka cluster.
kafka_schema_registry bool
Defines whether the schema registry is enabled on a Kafka cluster
maintenance_time str
Time on which maintenances can start every day.
network_type str
Type of network of the cluster.
nodes Sequence[cloudprojectdatabase.GetDatabaseNode]
List of nodes object.
opensearch_acls_enabled bool
plan str
Plan of the cluster.
service_name str
See Argument Reference above.
status str
Current status of the cluster.
version str
The version of the engine in which the service should be deployed
advancedConfiguration Map<String>
Advanced configuration key / value.
backupRegions List<String>
List of region where backups are pushed.
backupTime String
Time on which backups start every day.
createdAt String
Date of the creation of the cluster.
description String
Description of the IP restriction
diskSize Number
The disk size (in GB) of the database service.
diskType String
The disk type of the database service.
endpoints List<Property Map>
List of all endpoints objects of the service.
engine String
See Argument Reference above.
flavor String
A valid OVHcloud public cloud database flavor name in which the nodes will be started.
id String
See Argument Reference above.
ipRestrictions List<Property Map>
IP Blocks authorized to access to the cluster.
kafkaRestApi Boolean
Defines whether the REST API is enabled on a kafka cluster.
kafkaSchemaRegistry Boolean
Defines whether the schema registry is enabled on a Kafka cluster
maintenanceTime String
Time on which maintenances can start every day.
networkType String
Type of network of the cluster.
nodes List<Property Map>
List of nodes object.
opensearchAclsEnabled Boolean
plan String
Plan of the cluster.
serviceName String
See Argument Reference above.
status String
Current status of the cluster.
version String
The version of the engine in which the service should be deployed

Supporting Types

GetDatabaseEndpoint

Component This property is required. string
Type of component the URI relates to.
Domain This property is required. string
Domain of the cluster.
Path This property is required. string
Path of the endpoint.
Port This property is required. int
Connection port for the endpoint.
Scheme This property is required. string
Scheme used to generate the URI.
Ssl This property is required. bool
Defines whether the endpoint uses SSL.
SslMode This property is required. string
SSL mode used to connect to the service if the SSL is enabled.
Uri This property is required. string
URI of the endpoint.
Component This property is required. string
Type of component the URI relates to.
Domain This property is required. string
Domain of the cluster.
Path This property is required. string
Path of the endpoint.
Port This property is required. int
Connection port for the endpoint.
Scheme This property is required. string
Scheme used to generate the URI.
Ssl This property is required. bool
Defines whether the endpoint uses SSL.
SslMode This property is required. string
SSL mode used to connect to the service if the SSL is enabled.
Uri This property is required. string
URI of the endpoint.
component This property is required. String
Type of component the URI relates to.
domain This property is required. String
Domain of the cluster.
path This property is required. String
Path of the endpoint.
port This property is required. Integer
Connection port for the endpoint.
scheme This property is required. String
Scheme used to generate the URI.
ssl This property is required. Boolean
Defines whether the endpoint uses SSL.
sslMode This property is required. String
SSL mode used to connect to the service if the SSL is enabled.
uri This property is required. String
URI of the endpoint.
component This property is required. string
Type of component the URI relates to.
domain This property is required. string
Domain of the cluster.
path This property is required. string
Path of the endpoint.
port This property is required. number
Connection port for the endpoint.
scheme This property is required. string
Scheme used to generate the URI.
ssl This property is required. boolean
Defines whether the endpoint uses SSL.
sslMode This property is required. string
SSL mode used to connect to the service if the SSL is enabled.
uri This property is required. string
URI of the endpoint.
component This property is required. str
Type of component the URI relates to.
domain This property is required. str
Domain of the cluster.
path This property is required. str
Path of the endpoint.
port This property is required. int
Connection port for the endpoint.
scheme This property is required. str
Scheme used to generate the URI.
ssl This property is required. bool
Defines whether the endpoint uses SSL.
ssl_mode This property is required. str
SSL mode used to connect to the service if the SSL is enabled.
uri This property is required. str
URI of the endpoint.
component This property is required. String
Type of component the URI relates to.
domain This property is required. String
Domain of the cluster.
path This property is required. String
Path of the endpoint.
port This property is required. Number
Connection port for the endpoint.
scheme This property is required. String
Scheme used to generate the URI.
ssl This property is required. Boolean
Defines whether the endpoint uses SSL.
sslMode This property is required. String
SSL mode used to connect to the service if the SSL is enabled.
uri This property is required. String
URI of the endpoint.

GetDatabaseIpRestriction

Description This property is required. string
Description of the IP restriction
Ip This property is required. string
Authorized IP
Status This property is required. string
Current status of the cluster.
Description This property is required. string
Description of the IP restriction
Ip This property is required. string
Authorized IP
Status This property is required. string
Current status of the cluster.
description This property is required. String
Description of the IP restriction
ip This property is required. String
Authorized IP
status This property is required. String
Current status of the cluster.
description This property is required. string
Description of the IP restriction
ip This property is required. string
Authorized IP
status This property is required. string
Current status of the cluster.
description This property is required. str
Description of the IP restriction
ip This property is required. str
Authorized IP
status This property is required. str
Current status of the cluster.
description This property is required. String
Description of the IP restriction
ip This property is required. String
Authorized IP
status This property is required. String
Current status of the cluster.

GetDatabaseNode

NetworkId This property is required. string
Private network id in which the node should be deployed. It's the regional openstackId of the private network
Region This property is required. string
Public cloud region in which the node should be deployed.
SubnetId This property is required. string
Private subnet ID in which the node is.
NetworkId This property is required. string
Private network id in which the node should be deployed. It's the regional openstackId of the private network
Region This property is required. string
Public cloud region in which the node should be deployed.
SubnetId This property is required. string
Private subnet ID in which the node is.
networkId This property is required. String
Private network id in which the node should be deployed. It's the regional openstackId of the private network
region This property is required. String
Public cloud region in which the node should be deployed.
subnetId This property is required. String
Private subnet ID in which the node is.
networkId This property is required. string
Private network id in which the node should be deployed. It's the regional openstackId of the private network
region This property is required. string
Public cloud region in which the node should be deployed.
subnetId This property is required. string
Private subnet ID in which the node is.
network_id This property is required. str
Private network id in which the node should be deployed. It's the regional openstackId of the private network
region This property is required. str
Public cloud region in which the node should be deployed.
subnet_id This property is required. str
Private subnet ID in which the node is.
networkId This property is required. String
Private network id in which the node should be deployed. It's the regional openstackId of the private network
region This property is required. String
Public cloud region in which the node should be deployed.
subnetId This property is required. String
Private subnet ID in which the node is.

Package Details

Repository
ovh ovh/pulumi-ovh
License
Apache-2.0
Notes
This Pulumi package is based on the ovh Terraform Provider.
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud