ovh.CloudProjectDatabase.getDatabases

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

Example Usage

To get the list of database clusters service for a given engine

using System.Collections.Generic;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var dbs = Ovh.CloudProjectDatabase.GetDatabases.Invoke(new()
    {
        ServiceName = "XXXXXX",
        Engine = "YYYY",
    });

    return new Dictionary<string, object?>
    {
        ["clusterIds"] = dbs.Apply(getDatabasesResult => getDatabasesResult.ClusterIds),
    };
});
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 {
		dbs, err := CloudProjectDatabase.GetDatabases(ctx, &cloudprojectdatabase.GetDatabasesArgs{
			ServiceName: "XXXXXX",
			Engine:      "YYYY",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("clusterIds", dbs.ClusterIds)
		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.GetDatabasesArgs;
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 dbs = CloudProjectDatabaseFunctions.getDatabases(GetDatabasesArgs.builder()
            .serviceName("XXXXXX")
            .engine("YYYY")
            .build());

        ctx.export("clusterIds", dbs.applyValue(getDatabasesResult -> getDatabasesResult.clusterIds()));
    }
}
import pulumi
import pulumi_ovh as ovh

dbs = ovh.CloudProjectDatabase.get_databases(service_name="XXXXXX",
    engine="YYYY")
pulumi.export("clusterIds", dbs.cluster_ids)
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";

const dbs = ovh.CloudProjectDatabase.getDatabases({
    serviceName: "XXXXXX",
    engine: "YYYY",
});
export const clusterIds = dbs.then(dbs => dbs.clusterIds);
variables:
  dbs:
    fn::invoke:
      Function: ovh:CloudProjectDatabase:getDatabases
      Arguments:
        serviceName: XXXXXX
        engine: YYYY
outputs:
  clusterIds: ${dbs.clusterIds}

Using getDatabases

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 getDatabases(args: GetDatabasesArgs, opts?: InvokeOptions): Promise<GetDatabasesResult>
function getDatabasesOutput(args: GetDatabasesOutputArgs, opts?: InvokeOptions): Output<GetDatabasesResult>
def get_databases(engine: Optional[str] = None,
                  service_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetDatabasesResult
def get_databases_output(engine: Optional[pulumi.Input[str]] = None,
                  service_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetDatabasesResult]
func GetDatabases(ctx *Context, args *GetDatabasesArgs, opts ...InvokeOption) (*GetDatabasesResult, error)
func GetDatabasesOutput(ctx *Context, args *GetDatabasesOutputArgs, opts ...InvokeOption) GetDatabasesResultOutput

> Note: This function is named GetDatabases in the Go SDK.

public static class GetDatabases 
{
    public static Task<GetDatabasesResult> InvokeAsync(GetDatabasesArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabasesResult> Invoke(GetDatabasesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatabasesResult> getDatabases(GetDatabasesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: ovh:CloudProjectDatabase/getDatabases:getDatabases
  arguments:
    # arguments dictionary

The following arguments are supported:

Engine string

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

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 list. To get a full list of available engine visit: public documentation.

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 list. To get a full list of available engine visit: public documentation.

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 list. To get a full list of available engine visit: public documentation.

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 list. To get a full list of available engine visit: public documentation.

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 list. To get a full list of available engine visit: public documentation.

serviceName String

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

getDatabases Result

The following output properties are available:

ClusterIds List<string>

The list of managed databases ids of the project.

Engine string

See Argument Reference above.

Id string

The provider-assigned unique ID for this managed resource.

ServiceName string

See Argument Reference above.

ClusterIds []string

The list of managed databases ids of the project.

Engine string

See Argument Reference above.

Id string

The provider-assigned unique ID for this managed resource.

ServiceName string

See Argument Reference above.

clusterIds List<String>

The list of managed databases ids of the project.

engine String

See Argument Reference above.

id String

The provider-assigned unique ID for this managed resource.

serviceName String

See Argument Reference above.

clusterIds string[]

The list of managed databases ids of the project.

engine string

See Argument Reference above.

id string

The provider-assigned unique ID for this managed resource.

serviceName string

See Argument Reference above.

cluster_ids Sequence[str]

The list of managed databases ids of the project.

engine str

See Argument Reference above.

id str

The provider-assigned unique ID for this managed resource.

service_name str

See Argument Reference above.

clusterIds List<String>

The list of managed databases ids of the project.

engine String

See Argument Reference above.

id String

The provider-assigned unique ID for this managed resource.

serviceName String

See Argument Reference above.

Package Details

Repository
ovh lbrlabs/pulumi-ovh
License
Apache-2.0
Notes

This Pulumi package is based on the ovh Terraform Provider.