Ovh

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

getDatabaseInstances

Use this data source to get the list of databases of a database cluster associated with a public cloud project.

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var databases = Ovh.CloudProjectDatabase.GetDatabaseInstances.Invoke(new()
    {
        ServiceName = "XXXX",
        Engine = "YYYY",
        ClusterId = "ZZZ",
    });

    return new Dictionary<string, object?>
    {
        ["databaseIds"] = databases.Apply(getDatabaseInstancesResult => getDatabaseInstancesResult.DatabaseIds),
    };
});
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 {
		databases, err := CloudProjectDatabase.GetDatabaseInstances(ctx, &cloudprojectdatabase.GetDatabaseInstancesArgs{
			ServiceName: "XXXX",
			Engine:      "YYYY",
			ClusterId:   "ZZZ",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("databaseIds", databases.DatabaseIds)
		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.GetDatabaseInstancesArgs;
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 databases = CloudProjectDatabaseFunctions.getDatabaseInstances(GetDatabaseInstancesArgs.builder()
            .serviceName("XXXX")
            .engine("YYYY")
            .clusterId("ZZZ")
            .build());

        ctx.export("databaseIds", databases.applyValue(getDatabaseInstancesResult -> getDatabaseInstancesResult.databaseIds()));
    }
}
import pulumi
import pulumi_ovh as ovh

databases = ovh.CloudProjectDatabase.get_database_instances(service_name="XXXX",
    engine="YYYY",
    cluster_id="ZZZ")
pulumi.export("databaseIds", databases.database_ids)
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";

const databases = ovh.CloudProjectDatabase.getDatabaseInstances({
    serviceName: "XXXX",
    engine: "YYYY",
    clusterId: "ZZZ",
});
export const databaseIds = databases.then(databases => databases.databaseIds);
variables:
  databases:
    fn::invoke:
      Function: ovh:CloudProjectDatabase:getDatabaseInstances
      Arguments:
        serviceName: XXXX
        engine: YYYY
        clusterId: ZZZ
outputs:
  databaseIds: ${databases.databaseIds}

Using getDatabaseInstances

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 getDatabaseInstances(args: GetDatabaseInstancesArgs, opts?: InvokeOptions): Promise<GetDatabaseInstancesResult>
function getDatabaseInstancesOutput(args: GetDatabaseInstancesOutputArgs, opts?: InvokeOptions): Output<GetDatabaseInstancesResult>
def get_database_instances(cluster_id: Optional[str] = None,
                           engine: Optional[str] = None,
                           service_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetDatabaseInstancesResult
def get_database_instances_output(cluster_id: Optional[pulumi.Input[str]] = None,
                           engine: Optional[pulumi.Input[str]] = None,
                           service_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseInstancesResult]
func GetDatabaseInstances(ctx *Context, args *GetDatabaseInstancesArgs, opts ...InvokeOption) (*GetDatabaseInstancesResult, error)
func GetDatabaseInstancesOutput(ctx *Context, args *GetDatabaseInstancesOutputArgs, opts ...InvokeOption) GetDatabaseInstancesResultOutput

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

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

The following arguments are supported:

ClusterId string

Cluster ID

Engine string

The engine of the database cluster you want to list databases. To get a full list of available engine visit: public documentation. Available engines:

  • mysql
  • postgresql
ServiceName string

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

ClusterId string

Cluster ID

Engine string

The engine of the database cluster you want to list databases. To get a full list of available engine visit: public documentation. Available engines:

  • mysql
  • postgresql
ServiceName string

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

clusterId String

Cluster ID

engine String

The engine of the database cluster you want to list databases. To get a full list of available engine visit: public documentation. Available engines:

  • mysql
  • postgresql
serviceName String

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

clusterId string

Cluster ID

engine string

The engine of the database cluster you want to list databases. To get a full list of available engine visit: public documentation. Available engines:

  • mysql
  • postgresql
serviceName string

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

cluster_id str

Cluster ID

engine str

The engine of the database cluster you want to list databases. To get a full list of available engine visit: public documentation. Available engines:

  • mysql
  • postgresql
service_name str

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

clusterId String

Cluster ID

engine String

The engine of the database cluster you want to list databases. To get a full list of available engine visit: public documentation. Available engines:

  • mysql
  • postgresql
serviceName String

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

getDatabaseInstances Result

The following output properties are available:

ClusterId string

See Argument Reference above.

DatabaseIds List<string>

The list of databases ids of the database cluster associated with 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.

ClusterId string

See Argument Reference above.

DatabaseIds []string

The list of databases ids of the database cluster associated with 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.

clusterId String

See Argument Reference above.

databaseIds List<String>

The list of databases ids of the database cluster associated with 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.

clusterId string

See Argument Reference above.

databaseIds string[]

The list of databases ids of the database cluster associated with 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_id str

See Argument Reference above.

database_ids Sequence[str]

The list of databases ids of the database cluster associated with 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.

clusterId String

See Argument Reference above.

databaseIds List<String>

The list of databases ids of the database cluster associated with 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
https://github.com/lbrlabs/pulumi-ovh
License
Apache-2.0
Notes

This Pulumi package is based on the ovh Terraform Provider.