Ovh

v0.1.0 published on Friday, Nov 4, 2022 by lbrlabs

getDatabase

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

Example Usage

To get information of a database cluster service

using System.Collections.Generic;
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),
    };
});
package main

import (
	"github.com/lbrlabs/pulumi-ovh/sdk/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
	})
}
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.applyValue(getDatabaseResult -> getDatabaseResult.id()));
    }
}
import pulumi
import pulumi_ovh as ovh

db = ovh.CloudProjectDatabase.get_database(service_name="XXXXXX",
    engine="YYYY",
    id="ZZZZ")
pulumi.export("clusterId", db.id)
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);
variables:
  db:
    fn::invoke:
      Function: ovh:CloudProjectDatabase:getDatabase
      Arguments:
        serviceName: XXXXXX
        engine: YYYY
        id: ZZZZ
outputs:
  clusterId: ${db.id}

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(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]
func GetDatabase(ctx *Context, args *GetDatabaseArgs, opts ...InvokeOption) (*GetDatabaseResult, error)
func GetDatabaseOutput(ctx *Context, args *GetDatabaseOutputArgs, opts ...InvokeOption) GetDatabaseResultOutput

> 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)
}
public static CompletableFuture<GetDatabaseResult> getDatabase(GetDatabaseArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: ovh:CloudProjectDatabase/getDatabase:getDatabase
  arguments:
    # arguments dictionary

The following arguments are supported:

Engine string

The database engine you want to get information. To get a full list of available engine visit: public documentation.

Id string

Cluster ID

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Engine string

The database engine you want to get information. To get a full list of available engine visit: public documentation.

Id string

Cluster ID

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

engine String

The database engine you want to get information. To get a full list of available engine visit: public documentation.

id String

Cluster ID

serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

engine string

The database engine you want to get information. To get a full list of available engine visit: public documentation.

id string

Cluster ID

serviceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

engine str

The database engine you want to get information. To get a full list of available engine visit: public documentation.

id str

Cluster ID

service_name str

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

engine String

The database engine you want to get information. To get a full list of available engine visit: public documentation.

id String

Cluster ID

serviceName 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:

BackupTime string

Time on which backups start every day.

CreatedAt string

Date of the creation of the cluster.

Description string

Small description of the database service.

Endpoints List<Lbrlabs.PulumiPackage.Ovh.CloudProjectDatabase.Outputs.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.

KafkaRestApi bool

Defines whether the REST API 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<Lbrlabs.PulumiPackage.Ovh.CloudProjectDatabase.Outputs.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

BackupTime string

Time on which backups start every day.

CreatedAt string

Date of the creation of the cluster.

Description string

Small description 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.

KafkaRestApi bool

Defines whether the REST API 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

backupTime String

Time on which backups start every day.

createdAt String

Date of the creation of the cluster.

description String

Small description 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.

kafkaRestApi Boolean

Defines whether the REST API 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

backupTime string

Time on which backups start every day.

createdAt string

Date of the creation of the cluster.

description string

Small description 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.

kafkaRestApi boolean

Defines whether the REST API 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

backup_time str

Time on which backups start every day.

created_at str

Date of the creation of the cluster.

description str

Small description of the database service.

endpoints 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.

kafka_rest_api bool

Defines whether the REST API 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 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

backupTime String

Time on which backups start every day.

createdAt String

Date of the creation of the cluster.

description String

Small description 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.

kafkaRestApi Boolean

Defines whether the REST API 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 string

Type of component the URI relates to.

Domain string

Domain of the cluster.

Path string

Path of the endpoint.

Port int

Connection port for the endpoint.

Scheme string

Scheme used to generate the URI.

Ssl bool

Defines whether the endpoint uses SSL.

SslMode string

SSL mode used to connect to the service if the SSL is enabled.

Uri string

URI of the endpoint.

Component string

Type of component the URI relates to.

Domain string

Domain of the cluster.

Path string

Path of the endpoint.

Port int

Connection port for the endpoint.

Scheme string

Scheme used to generate the URI.

Ssl bool

Defines whether the endpoint uses SSL.

SslMode string

SSL mode used to connect to the service if the SSL is enabled.

Uri string

URI of the endpoint.

component String

Type of component the URI relates to.

domain String

Domain of the cluster.

path String

Path of the endpoint.

port Integer

Connection port for the endpoint.

scheme String

Scheme used to generate the URI.

ssl Boolean

Defines whether the endpoint uses SSL.

sslMode String

SSL mode used to connect to the service if the SSL is enabled.

uri String

URI of the endpoint.

component string

Type of component the URI relates to.

domain string

Domain of the cluster.

path string

Path of the endpoint.

port number

Connection port for the endpoint.

scheme string

Scheme used to generate the URI.

ssl boolean

Defines whether the endpoint uses SSL.

sslMode string

SSL mode used to connect to the service if the SSL is enabled.

uri string

URI of the endpoint.

component str

Type of component the URI relates to.

domain str

Domain of the cluster.

path str

Path of the endpoint.

port int

Connection port for the endpoint.

scheme str

Scheme used to generate the URI.

ssl bool

Defines whether the endpoint uses SSL.

ssl_mode str

SSL mode used to connect to the service if the SSL is enabled.

uri str

URI of the endpoint.

component String

Type of component the URI relates to.

domain String

Domain of the cluster.

path String

Path of the endpoint.

port Number

Connection port for the endpoint.

scheme String

Scheme used to generate the URI.

ssl Boolean

Defines whether the endpoint uses SSL.

sslMode String

SSL mode used to connect to the service if the SSL is enabled.

uri String

URI of the endpoint.

GetDatabaseNode

NetworkId string

Private network id in which the node should be deployed. It's the regional openstackId of the private network

Region string

Public cloud region in which the node should be deployed.

SubnetId string

Private subnet ID in which the node is.

NetworkId string

Private network id in which the node should be deployed. It's the regional openstackId of the private network

Region string

Public cloud region in which the node should be deployed.

SubnetId string

Private subnet ID in which the node is.

networkId String

Private network id in which the node should be deployed. It's the regional openstackId of the private network

region String

Public cloud region in which the node should be deployed.

subnetId String

Private subnet ID in which the node is.

networkId string

Private network id in which the node should be deployed. It's the regional openstackId of the private network

region string

Public cloud region in which the node should be deployed.

subnetId string

Private subnet ID in which the node is.

network_id str

Private network id in which the node should be deployed. It's the regional openstackId of the private network

region str

Public cloud region in which the node should be deployed.

subnet_id str

Private subnet ID in which the node is.

networkId String

Private network id in which the node should be deployed. It's the regional openstackId of the private network

region String

Public cloud region in which the node should be deployed.

subnetId String

Private subnet ID in which the node is.

Package Details

Repository
https://github.com/lbrlabs/pulumi-ovh
License
Apache-2.0
Notes

This Pulumi package is based on the ovh Terraform Provider.