databricks.DatabaseDatabaseCatalog
Explore with Pulumi AI
Database Catalogs are databases inside a Lakebase Database Instance which are synced into a Postgres Catalog inside Unity Catalog.
Example Usage
Example
This example creates a Database Catalog based on an existing database in the Database Instance
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const _this = new databricks.DatabaseDatabaseCatalog("this", {
name: "my_registered_catalog",
databaseInstanceName: "my-database-instance",
databaseName: "databricks_postgres",
});
import pulumi
import pulumi_databricks as databricks
this = databricks.DatabaseDatabaseCatalog("this",
name="my_registered_catalog",
database_instance_name="my-database-instance",
database_name="databricks_postgres")
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 {
_, err := databricks.NewDatabaseDatabaseCatalog(ctx, "this", &databricks.DatabaseDatabaseCatalogArgs{
Name: pulumi.String("my_registered_catalog"),
DatabaseInstanceName: pulumi.String("my-database-instance"),
DatabaseName: pulumi.String("databricks_postgres"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var @this = new Databricks.DatabaseDatabaseCatalog("this", new()
{
Name = "my_registered_catalog",
DatabaseInstanceName = "my-database-instance",
DatabaseName = "databricks_postgres",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabaseDatabaseCatalog;
import com.pulumi.databricks.DatabaseDatabaseCatalogArgs;
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) {
var this_ = new DatabaseDatabaseCatalog("this", DatabaseDatabaseCatalogArgs.builder()
.name("my_registered_catalog")
.databaseInstanceName("my-database-instance")
.databaseName("databricks_postgres")
.build());
}
}
resources:
this:
type: databricks:DatabaseDatabaseCatalog
properties:
name: my_registered_catalog
databaseInstanceName: my-database-instance
databaseName: databricks_postgres
This example creates a Database Catalog along with a new database inside an existing Database Instance
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const _this = new databricks.DatabaseDatabaseCatalog("this", {
name: "my_registered_catalog",
databaseInstanceName: "my-database-instance",
databaseName: "new_registered_catalog_database",
createDatabaseIfNotExists: true,
});
import pulumi
import pulumi_databricks as databricks
this = databricks.DatabaseDatabaseCatalog("this",
name="my_registered_catalog",
database_instance_name="my-database-instance",
database_name="new_registered_catalog_database",
create_database_if_not_exists=True)
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 {
_, err := databricks.NewDatabaseDatabaseCatalog(ctx, "this", &databricks.DatabaseDatabaseCatalogArgs{
Name: pulumi.String("my_registered_catalog"),
DatabaseInstanceName: pulumi.String("my-database-instance"),
DatabaseName: pulumi.String("new_registered_catalog_database"),
CreateDatabaseIfNotExists: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var @this = new Databricks.DatabaseDatabaseCatalog("this", new()
{
Name = "my_registered_catalog",
DatabaseInstanceName = "my-database-instance",
DatabaseName = "new_registered_catalog_database",
CreateDatabaseIfNotExists = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabaseDatabaseCatalog;
import com.pulumi.databricks.DatabaseDatabaseCatalogArgs;
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) {
var this_ = new DatabaseDatabaseCatalog("this", DatabaseDatabaseCatalogArgs.builder()
.name("my_registered_catalog")
.databaseInstanceName("my-database-instance")
.databaseName("new_registered_catalog_database")
.createDatabaseIfNotExists(true)
.build());
}
}
resources:
this:
type: databricks:DatabaseDatabaseCatalog
properties:
name: my_registered_catalog
databaseInstanceName: my-database-instance
databaseName: new_registered_catalog_database
createDatabaseIfNotExists: true
This example creates a DatabaseInstance and then a Database Catalog inside it
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const instance = new databricks.DatabaseInstance("instance", {
name: "my-database-instance",
capacity: "CU_1",
});
const catalog = new databricks.DatabaseDatabaseCatalog("catalog", {
name: "my_registered_catalog",
databaseInstanceName: instance.name,
databaseName: "new_registered_catalog_database",
createDatabaseIfNotExists: true,
});
import pulumi
import pulumi_databricks as databricks
instance = databricks.DatabaseInstance("instance",
name="my-database-instance",
capacity="CU_1")
catalog = databricks.DatabaseDatabaseCatalog("catalog",
name="my_registered_catalog",
database_instance_name=instance.name,
database_name="new_registered_catalog_database",
create_database_if_not_exists=True)
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 {
instance, err := databricks.NewDatabaseInstance(ctx, "instance", &databricks.DatabaseInstanceArgs{
Name: pulumi.String("my-database-instance"),
Capacity: pulumi.String("CU_1"),
})
if err != nil {
return err
}
_, err = databricks.NewDatabaseDatabaseCatalog(ctx, "catalog", &databricks.DatabaseDatabaseCatalogArgs{
Name: pulumi.String("my_registered_catalog"),
DatabaseInstanceName: instance.Name,
DatabaseName: pulumi.String("new_registered_catalog_database"),
CreateDatabaseIfNotExists: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var instance = new Databricks.DatabaseInstance("instance", new()
{
Name = "my-database-instance",
Capacity = "CU_1",
});
var catalog = new Databricks.DatabaseDatabaseCatalog("catalog", new()
{
Name = "my_registered_catalog",
DatabaseInstanceName = instance.Name,
DatabaseName = "new_registered_catalog_database",
CreateDatabaseIfNotExists = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabaseInstance;
import com.pulumi.databricks.DatabaseInstanceArgs;
import com.pulumi.databricks.DatabaseDatabaseCatalog;
import com.pulumi.databricks.DatabaseDatabaseCatalogArgs;
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) {
var instance = new DatabaseInstance("instance", DatabaseInstanceArgs.builder()
.name("my-database-instance")
.capacity("CU_1")
.build());
var catalog = new DatabaseDatabaseCatalog("catalog", DatabaseDatabaseCatalogArgs.builder()
.name("my_registered_catalog")
.databaseInstanceName(instance.name())
.databaseName("new_registered_catalog_database")
.createDatabaseIfNotExists(true)
.build());
}
}
resources:
instance:
type: databricks:DatabaseInstance
properties:
name: my-database-instance
capacity: CU_1
catalog:
type: databricks:DatabaseDatabaseCatalog
properties:
name: my_registered_catalog
databaseInstanceName: ${instance.name}
databaseName: new_registered_catalog_database
createDatabaseIfNotExists: true
Create DatabaseDatabaseCatalog Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DatabaseDatabaseCatalog(name: string, args: DatabaseDatabaseCatalogArgs, opts?: CustomResourceOptions);
@overload
def DatabaseDatabaseCatalog(resource_name: str,
args: DatabaseDatabaseCatalogArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DatabaseDatabaseCatalog(resource_name: str,
opts: Optional[ResourceOptions] = None,
database_instance_name: Optional[str] = None,
database_name: Optional[str] = None,
create_database_if_not_exists: Optional[bool] = None,
name: Optional[str] = None)
func NewDatabaseDatabaseCatalog(ctx *Context, name string, args DatabaseDatabaseCatalogArgs, opts ...ResourceOption) (*DatabaseDatabaseCatalog, error)
public DatabaseDatabaseCatalog(string name, DatabaseDatabaseCatalogArgs args, CustomResourceOptions? opts = null)
public DatabaseDatabaseCatalog(String name, DatabaseDatabaseCatalogArgs args)
public DatabaseDatabaseCatalog(String name, DatabaseDatabaseCatalogArgs args, CustomResourceOptions options)
type: databricks:DatabaseDatabaseCatalog
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DatabaseDatabaseCatalogArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DatabaseDatabaseCatalogArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabaseDatabaseCatalogArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseDatabaseCatalogArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseDatabaseCatalogArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var databaseDatabaseCatalogResource = new Databricks.DatabaseDatabaseCatalog("databaseDatabaseCatalogResource", new()
{
DatabaseInstanceName = "string",
DatabaseName = "string",
CreateDatabaseIfNotExists = false,
Name = "string",
});
example, err := databricks.NewDatabaseDatabaseCatalog(ctx, "databaseDatabaseCatalogResource", &databricks.DatabaseDatabaseCatalogArgs{
DatabaseInstanceName: pulumi.String("string"),
DatabaseName: pulumi.String("string"),
CreateDatabaseIfNotExists: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var databaseDatabaseCatalogResource = new DatabaseDatabaseCatalog("databaseDatabaseCatalogResource", DatabaseDatabaseCatalogArgs.builder()
.databaseInstanceName("string")
.databaseName("string")
.createDatabaseIfNotExists(false)
.name("string")
.build());
database_database_catalog_resource = databricks.DatabaseDatabaseCatalog("databaseDatabaseCatalogResource",
database_instance_name="string",
database_name="string",
create_database_if_not_exists=False,
name="string")
const databaseDatabaseCatalogResource = new databricks.DatabaseDatabaseCatalog("databaseDatabaseCatalogResource", {
databaseInstanceName: "string",
databaseName: "string",
createDatabaseIfNotExists: false,
name: "string",
});
type: databricks:DatabaseDatabaseCatalog
properties:
createDatabaseIfNotExists: false
databaseInstanceName: string
databaseName: string
name: string
DatabaseDatabaseCatalog Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The DatabaseDatabaseCatalog resource accepts the following input properties:
- Database
Instance stringName - The name of the DatabaseInstance housing the database
- Database
Name string - The name of the database (in a instance) associated with the catalog
- Create
Database boolIf Not Exists - Name string
- The name of the catalog in UC
- Database
Instance stringName - The name of the DatabaseInstance housing the database
- Database
Name string - The name of the database (in a instance) associated with the catalog
- Create
Database boolIf Not Exists - Name string
- The name of the catalog in UC
- database
Instance StringName - The name of the DatabaseInstance housing the database
- database
Name String - The name of the database (in a instance) associated with the catalog
- create
Database BooleanIf Not Exists - name String
- The name of the catalog in UC
- database
Instance stringName - The name of the DatabaseInstance housing the database
- database
Name string - The name of the database (in a instance) associated with the catalog
- create
Database booleanIf Not Exists - name string
- The name of the catalog in UC
- database_
instance_ strname - The name of the DatabaseInstance housing the database
- database_
name str - The name of the database (in a instance) associated with the catalog
- create_
database_ boolif_ not_ exists - name str
- The name of the catalog in UC
- database
Instance StringName - The name of the DatabaseInstance housing the database
- database
Name String - The name of the database (in a instance) associated with the catalog
- create
Database BooleanIf Not Exists - name String
- The name of the catalog in UC
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseDatabaseCatalog resource produces the following output properties:
Look up Existing DatabaseDatabaseCatalog Resource
Get an existing DatabaseDatabaseCatalog resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DatabaseDatabaseCatalogState, opts?: CustomResourceOptions): DatabaseDatabaseCatalog
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_database_if_not_exists: Optional[bool] = None,
database_instance_name: Optional[str] = None,
database_name: Optional[str] = None,
name: Optional[str] = None,
uid: Optional[str] = None) -> DatabaseDatabaseCatalog
func GetDatabaseDatabaseCatalog(ctx *Context, name string, id IDInput, state *DatabaseDatabaseCatalogState, opts ...ResourceOption) (*DatabaseDatabaseCatalog, error)
public static DatabaseDatabaseCatalog Get(string name, Input<string> id, DatabaseDatabaseCatalogState? state, CustomResourceOptions? opts = null)
public static DatabaseDatabaseCatalog get(String name, Output<String> id, DatabaseDatabaseCatalogState state, CustomResourceOptions options)
resources: _: type: databricks:DatabaseDatabaseCatalog get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Create
Database boolIf Not Exists - Database
Instance stringName - The name of the DatabaseInstance housing the database
- Database
Name string - The name of the database (in a instance) associated with the catalog
- Name string
- The name of the catalog in UC
- Uid string
- (string)
- Create
Database boolIf Not Exists - Database
Instance stringName - The name of the DatabaseInstance housing the database
- Database
Name string - The name of the database (in a instance) associated with the catalog
- Name string
- The name of the catalog in UC
- Uid string
- (string)
- create
Database BooleanIf Not Exists - database
Instance StringName - The name of the DatabaseInstance housing the database
- database
Name String - The name of the database (in a instance) associated with the catalog
- name String
- The name of the catalog in UC
- uid String
- (string)
- create
Database booleanIf Not Exists - database
Instance stringName - The name of the DatabaseInstance housing the database
- database
Name string - The name of the database (in a instance) associated with the catalog
- name string
- The name of the catalog in UC
- uid string
- (string)
- create_
database_ boolif_ not_ exists - database_
instance_ strname - The name of the DatabaseInstance housing the database
- database_
name str - The name of the database (in a instance) associated with the catalog
- name str
- The name of the catalog in UC
- uid str
- (string)
- create
Database BooleanIf Not Exists - database
Instance StringName - The name of the DatabaseInstance housing the database
- database
Name String - The name of the database (in a instance) associated with the catalog
- name String
- The name of the catalog in UC
- uid String
- (string)
Import
As of Pulumi v1.5, resources can be imported through configuration.
hcl
import {
id = name
to = databricks_database_database_catalog.this
}
If you are using an older version of Pulumi, import the resource using the pulumi import
command as follows:
$ pulumi import databricks:index/databaseDatabaseCatalog:DatabaseDatabaseCatalog databricks_database_database_catalog name
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricks
Terraform Provider.