Viewing docs for Databricks v1.91.1
published on Friday, May 1, 2026 by Pulumi
published on Friday, May 1, 2026 by Pulumi
Viewing docs for Databricks v1.91.1
published on Friday, May 1, 2026 by Pulumi
published on Friday, May 1, 2026 by Pulumi
This data source retrieves a single Postgres database.
Example Usage
Retrieve Database by Name
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const _this = databricks.getPostgresDatabase({
name: "projects/my-project/branches/main/databases/app",
});
export const postgresDatabaseName = _this.then(_this => _this.status?.postgresDatabase);
export const databaseOwnerRole = _this.then(_this => _this.status?.role);
import pulumi
import pulumi_databricks as databricks
this = databricks.get_postgres_database(name="projects/my-project/branches/main/databases/app")
pulumi.export("postgresDatabaseName", this.status.postgres_database)
pulumi.export("databaseOwnerRole", this.status.role)
package main
import (
"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
this, err := databricks.GetPostgresDatabase(ctx, &databricks.LookupPostgresDatabaseArgs{
Name: "projects/my-project/branches/main/databases/app",
}, nil)
if err != nil {
return err
}
ctx.Export("postgresDatabaseName", this.Status.PostgresDatabase)
ctx.Export("databaseOwnerRole", this.Status.Role)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var @this = Databricks.Index.GetPostgresDatabase.Invoke(new()
{
Name = "projects/my-project/branches/main/databases/app",
});
return new Dictionary<string, object?>
{
["postgresDatabaseName"] = @this.Apply(@this => @this.Apply(getPostgresDatabaseResult => getPostgresDatabaseResult.Status?.PostgresDatabase)),
["databaseOwnerRole"] = @this.Apply(@this => @this.Apply(getPostgresDatabaseResult => getPostgresDatabaseResult.Status?.Role)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetPostgresDatabaseArgs;
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 this = DatabricksFunctions.getPostgresDatabase(GetPostgresDatabaseArgs.builder()
.name("projects/my-project/branches/main/databases/app")
.build());
ctx.export("postgresDatabaseName", this_.status().postgresDatabase());
ctx.export("databaseOwnerRole", this_.status().role());
}
}
variables:
this:
fn::invoke:
function: databricks:getPostgresDatabase
arguments:
name: projects/my-project/branches/main/databases/app
outputs:
postgresDatabaseName: ${this.status.postgresDatabase}
databaseOwnerRole: ${this.status.role}
Using getPostgresDatabase
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 getPostgresDatabase(args: GetPostgresDatabaseArgs, opts?: InvokeOptions): Promise<GetPostgresDatabaseResult>
function getPostgresDatabaseOutput(args: GetPostgresDatabaseOutputArgs, opts?: InvokeOptions): Output<GetPostgresDatabaseResult>def get_postgres_database(name: Optional[str] = None,
provider_config: Optional[GetPostgresDatabaseProviderConfig] = None,
opts: Optional[InvokeOptions] = None) -> GetPostgresDatabaseResult
def get_postgres_database_output(name: pulumi.Input[Optional[str]] = None,
provider_config: pulumi.Input[Optional[GetPostgresDatabaseProviderConfigArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPostgresDatabaseResult]func LookupPostgresDatabase(ctx *Context, args *LookupPostgresDatabaseArgs, opts ...InvokeOption) (*LookupPostgresDatabaseResult, error)
func LookupPostgresDatabaseOutput(ctx *Context, args *LookupPostgresDatabaseOutputArgs, opts ...InvokeOption) LookupPostgresDatabaseResultOutput> Note: This function is named LookupPostgresDatabase in the Go SDK.
public static class GetPostgresDatabase
{
public static Task<GetPostgresDatabaseResult> InvokeAsync(GetPostgresDatabaseArgs args, InvokeOptions? opts = null)
public static Output<GetPostgresDatabaseResult> Invoke(GetPostgresDatabaseInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPostgresDatabaseResult> getPostgresDatabase(GetPostgresDatabaseArgs args, InvokeOptions options)
public static Output<GetPostgresDatabaseResult> getPostgresDatabase(GetPostgresDatabaseArgs args, InvokeOptions options)
fn::invoke:
function: databricks:index/getPostgresDatabase:getPostgresDatabase
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- Provider
Config GetPostgres Database Provider Config - Configure the provider for management through account provider.
- Name string
- The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- Provider
Config GetPostgres Database Provider Config - Configure the provider for management through account provider.
- name String
- The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- provider
Config GetPostgres Database Provider Config - Configure the provider for management through account provider.
- name string
- The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- provider
Config GetPostgres Database Provider Config - Configure the provider for management through account provider.
- name str
- The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- provider_
config GetPostgres Database Provider Config - Configure the provider for management through account provider.
- name String
- The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- provider
Config Property Map - Configure the provider for management through account provider.
getPostgresDatabase Result
The following output properties are available:
- Create
Time string - (string) - A timestamp indicating when the database was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- (string) - The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- Parent string
- (string) - The branch containing this database. Format: projects/{project_id}/branches/{branch_id}
- Spec
Get
Postgres Database Spec - (DatabaseDatabaseSpec) - The desired state of the Database
- Status
Get
Postgres Database Status - (DatabaseDatabaseStatus) - The observed state of the Database
- Update
Time string - (string) - A timestamp indicating when the database was last updated
- Provider
Config GetPostgres Database Provider Config
- Create
Time string - (string) - A timestamp indicating when the database was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- (string) - The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- Parent string
- (string) - The branch containing this database. Format: projects/{project_id}/branches/{branch_id}
- Spec
Get
Postgres Database Spec - (DatabaseDatabaseSpec) - The desired state of the Database
- Status
Get
Postgres Database Status - (DatabaseDatabaseStatus) - The observed state of the Database
- Update
Time string - (string) - A timestamp indicating when the database was last updated
- Provider
Config GetPostgres Database Provider Config
- create
Time String - (string) - A timestamp indicating when the database was created
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- (string) - The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- parent String
- (string) - The branch containing this database. Format: projects/{project_id}/branches/{branch_id}
- spec
Get
Postgres Database Spec - (DatabaseDatabaseSpec) - The desired state of the Database
- status
Get
Postgres Database Status - (DatabaseDatabaseStatus) - The observed state of the Database
- update
Time String - (string) - A timestamp indicating when the database was last updated
- provider
Config GetPostgres Database Provider Config
- create
Time string - (string) - A timestamp indicating when the database was created
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- (string) - The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- parent string
- (string) - The branch containing this database. Format: projects/{project_id}/branches/{branch_id}
- spec
Get
Postgres Database Spec - (DatabaseDatabaseSpec) - The desired state of the Database
- status
Get
Postgres Database Status - (DatabaseDatabaseStatus) - The observed state of the Database
- update
Time string - (string) - A timestamp indicating when the database was last updated
- provider
Config GetPostgres Database Provider Config
- create_
time str - (string) - A timestamp indicating when the database was created
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- (string) - The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- parent str
- (string) - The branch containing this database. Format: projects/{project_id}/branches/{branch_id}
- spec
Get
Postgres Database Spec - (DatabaseDatabaseSpec) - The desired state of the Database
- status
Get
Postgres Database Status - (DatabaseDatabaseStatus) - The observed state of the Database
- update_
time str - (string) - A timestamp indicating when the database was last updated
- provider_
config GetPostgres Database Provider Config
- create
Time String - (string) - A timestamp indicating when the database was created
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- (string) - The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- parent String
- (string) - The branch containing this database. Format: projects/{project_id}/branches/{branch_id}
- spec Property Map
- (DatabaseDatabaseSpec) - The desired state of the Database
- status Property Map
- (DatabaseDatabaseStatus) - The observed state of the Database
- update
Time String - (string) - A timestamp indicating when the database was last updated
- provider
Config Property Map
Supporting Types
GetPostgresDatabaseProviderConfig
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace_
id str - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
GetPostgresDatabaseSpec
- Postgres
Database string - (string) - The name of the Postgres database
- Role string
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- Postgres
Database string - (string) - The name of the Postgres database
- Role string
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- postgres
Database String - (string) - The name of the Postgres database
- role String
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- postgres
Database string - (string) - The name of the Postgres database
- role string
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- postgres_
database str - (string) - The name of the Postgres database
- role str
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- postgres
Database String - (string) - The name of the Postgres database
- role String
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
GetPostgresDatabaseStatus
- Database
Id string - (string) - The short identifier of the database, suitable for showing to the users.
For a database with name
projects/my-project/branches/my-branch/databases/my-db, the databaseId ismy-db. - Postgres
Database string - (string) - The name of the Postgres database
- Role string
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- Database
Id string - (string) - The short identifier of the database, suitable for showing to the users.
For a database with name
projects/my-project/branches/my-branch/databases/my-db, the databaseId ismy-db. - Postgres
Database string - (string) - The name of the Postgres database
- Role string
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- database
Id String - (string) - The short identifier of the database, suitable for showing to the users.
For a database with name
projects/my-project/branches/my-branch/databases/my-db, the databaseId ismy-db. - postgres
Database String - (string) - The name of the Postgres database
- role String
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- database
Id string - (string) - The short identifier of the database, suitable for showing to the users.
For a database with name
projects/my-project/branches/my-branch/databases/my-db, the databaseId ismy-db. - postgres
Database string - (string) - The name of the Postgres database
- role string
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- database_
id str - (string) - The short identifier of the database, suitable for showing to the users.
For a database with name
projects/my-project/branches/my-branch/databases/my-db, the databaseId ismy-db. - postgres_
database str - (string) - The name of the Postgres database
- role str
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- database
Id String - (string) - The short identifier of the database, suitable for showing to the users.
For a database with name
projects/my-project/branches/my-branch/databases/my-db, the databaseId ismy-db. - postgres
Database String - (string) - The name of the Postgres database
- role String
- (string) - The name of the role that owns the database. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
Viewing docs for Databricks v1.91.1
published on Friday, May 1, 2026 by Pulumi
published on Friday, May 1, 2026 by Pulumi
