1. Packages
  2. Scaleway
  3. API Docs
  4. databases
  5. getDatabase
Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse

scaleway.databases.getDatabase

Explore with Pulumi AI

Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse

Gets information about a database.

Example Usage

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

// Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
const myDb = scaleway.databases.getDatabase({
    instanceId: "11111111-1111-1111-1111-111111111111",
    name: "foobar",
});
Copy
import pulumi
import pulumi_scaleway as scaleway

# Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
my_db = scaleway.databases.get_database(instance_id="11111111-1111-1111-1111-111111111111",
    name="foobar")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/databases"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
		_, err := databases.LookupDatabase(ctx, &databases.LookupDatabaseArgs{
			InstanceId: "11111111-1111-1111-1111-111111111111",
			Name:       "foobar",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;

return await Deployment.RunAsync(() => 
{
    // Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
    var myDb = Scaleway.Databases.GetDatabase.Invoke(new()
    {
        InstanceId = "11111111-1111-1111-1111-111111111111",
        Name = "foobar",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.databases.DatabasesFunctions;
import com.pulumi.scaleway.databases.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) {
        // Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
        final var myDb = DatabasesFunctions.getDatabase(GetDatabaseArgs.builder()
            .instanceId("11111111-1111-1111-1111-111111111111")
            .name("foobar")
            .build());

    }
}
Copy
variables:
  # Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
  myDb:
    fn::invoke:
      function: scaleway:databases:getDatabase
      arguments:
        instanceId: 11111111-1111-1111-1111-111111111111
        name: foobar
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(instance_id: Optional[str] = None,
                 name: Optional[str] = None,
                 region: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
def get_database_output(instance_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseResult]
Copy
func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)
func LookupDatabaseOutput(ctx *Context, args *LookupDatabaseOutputArgs, opts ...InvokeOption) LookupDatabaseResultOutput
Copy

> Note: This function is named LookupDatabase 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: scaleway:databases/getDatabase:getDatabase
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

InstanceId This property is required. string
The RDB instance ID.
Name This property is required. string
The name of the RDB instance.
Region string
InstanceId This property is required. string
The RDB instance ID.
Name This property is required. string
The name of the RDB instance.
Region string
instanceId This property is required. String
The RDB instance ID.
name This property is required. String
The name of the RDB instance.
region String
instanceId This property is required. string
The RDB instance ID.
name This property is required. string
The name of the RDB instance.
region string
instance_id This property is required. str
The RDB instance ID.
name This property is required. str
The name of the RDB instance.
region str
instanceId This property is required. String
The RDB instance ID.
name This property is required. String
The name of the RDB instance.
region String

getDatabase Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
InstanceId string
Managed bool
Whether the database is managed or not.
Name string
Owner string
The name of the owner of the database.
Size string
Size of the database (in bytes).
Region string
Id string
The provider-assigned unique ID for this managed resource.
InstanceId string
Managed bool
Whether the database is managed or not.
Name string
Owner string
The name of the owner of the database.
Size string
Size of the database (in bytes).
Region string
id String
The provider-assigned unique ID for this managed resource.
instanceId String
managed Boolean
Whether the database is managed or not.
name String
owner String
The name of the owner of the database.
size String
Size of the database (in bytes).
region String
id string
The provider-assigned unique ID for this managed resource.
instanceId string
managed boolean
Whether the database is managed or not.
name string
owner string
The name of the owner of the database.
size string
Size of the database (in bytes).
region string
id str
The provider-assigned unique ID for this managed resource.
instance_id str
managed bool
Whether the database is managed or not.
name str
owner str
The name of the owner of the database.
size str
Size of the database (in bytes).
region str
id String
The provider-assigned unique ID for this managed resource.
instanceId String
managed Boolean
Whether the database is managed or not.
name String
owner String
The name of the owner of the database.
size String
Size of the database (in bytes).
region String

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.
Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse