Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getDatabase

# Database Data Source

The Database data source provides information about the existing Aiven Database.

Example Usage

using Pulumi;
using Aiven = Pulumi.Aiven;

class MyStack : Stack
{
    public MyStack()
    {
        var mydatabase = Output.Create(Aiven.GetDatabase.InvokeAsync(new Aiven.GetDatabaseArgs
        {
            DatabaseName = "<DATABASE_NAME>",
            Project = aiven_project.Myproject.Project,
            ServiceName = aiven_service.Myservice.Service_name,
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aiven/sdk/v3/go/aiven"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := aiven.LookupDatabase(ctx, &aiven.LookupDatabaseArgs{
            DatabaseName: "<DATABASE_NAME>",
            Project:      aiven_project.Myproject.Project,
            ServiceName:  aiven_service.Myservice.Service_name,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aiven as aiven

mydatabase = aiven.get_database(database_name="<DATABASE_NAME>",
    project=aiven_project["myproject"]["project"],
    service_name=aiven_service["myservice"]["service_name"])
import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";

const mydatabase = pulumi.all([aiven_project_myproject.project, aiven_service_myservice.serviceName]).apply(([project, serviceName]) => aiven.getDatabase({
    databaseName: "<DATABASE_NAME>",
    project: project,
    serviceName: serviceName,
}, { async: true }));

Using getDatabase

function getDatabase(args: GetDatabaseArgs, opts?: InvokeOptions): Promise<GetDatabaseResult>
def get_database(database_name: Optional[str] = None, lc_collate: Optional[str] = None, lc_ctype: Optional[str] = None, project: Optional[str] = None, service_name: Optional[str] = None, termination_protection: Optional[bool] = None, opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)

Note: This function is named LookupDatabase in the Go SDK.

public static class GetDatabase {
    public static Task<GetDatabaseResult> InvokeAsync(GetDatabaseArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DatabaseName string

is the actual name of the database.

Project string

and service_name - (Required) define the project and service the database belongs to. They should be defined using reference as shown above to set up dependencies correctly.

ServiceName string
LcCollate string

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

LcCtype string

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

TerminationProtection bool
DatabaseName string

is the actual name of the database.

Project string

and service_name - (Required) define the project and service the database belongs to. They should be defined using reference as shown above to set up dependencies correctly.

ServiceName string
LcCollate string

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

LcCtype string

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

TerminationProtection bool
databaseName string

is the actual name of the database.

project string

and service_name - (Required) define the project and service the database belongs to. They should be defined using reference as shown above to set up dependencies correctly.

serviceName string
lcCollate string

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

lcCtype string

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

terminationProtection boolean
database_name str

is the actual name of the database.

project str

and service_name - (Required) define the project and service the database belongs to. They should be defined using reference as shown above to set up dependencies correctly.

service_name str
lc_collate str

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

lc_ctype str

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

termination_protection bool

getDatabase Result

The following output properties are available:

DatabaseName string
Id string

The provider-assigned unique ID for this managed resource.

Project string
ServiceName string
LcCollate string

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

LcCtype string

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

TerminationProtection bool
DatabaseName string
Id string

The provider-assigned unique ID for this managed resource.

Project string
ServiceName string
LcCollate string

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

LcCtype string

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

TerminationProtection bool
databaseName string
id string

The provider-assigned unique ID for this managed resource.

project string
serviceName string
lcCollate string

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

lcCtype string

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

terminationProtection boolean
database_name str
id str

The provider-assigned unique ID for this managed resource.

project str
service_name str
lc_collate str

default string sort order (LC_COLLATE) of the database. Default value: en_US.UTF-8.

lc_ctype str

default character classification (LC_CTYPE) of the database. Default value: en_US.UTF-8.

termination_protection bool

Package Details

Repository
https://github.com/pulumi/pulumi-aiven
License
Apache-2.0
Notes
This Pulumi package is based on the aiven Terraform Provider.