databricks.MetastoreAssignment
Explore with Pulumi AI
This resource can be used with an account or workspace-level provider.
A single databricks.Metastore can be shared across Databricks workspaces, and each linked workspace has a consistent view of the data and a single set of access policies. You can only create a single metastore for each region in which your organization operates.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const _this = new databricks.Metastore("this", {
name: "primary",
storageRoot: `s3://${metastore.id}/metastore`,
owner: "uc admins",
region: "us-east-1",
forceDestroy: true,
});
const thisMetastoreAssignment = new databricks.MetastoreAssignment("this", {
metastoreId: _this.id,
workspaceId: workspaceId,
});
import pulumi
import pulumi_databricks as databricks
this = databricks.Metastore("this",
name="primary",
storage_root=f"s3://{metastore['id']}/metastore",
owner="uc admins",
region="us-east-1",
force_destroy=True)
this_metastore_assignment = databricks.MetastoreAssignment("this",
metastore_id=this.id,
workspace_id=workspace_id)
package main
import (
"fmt"
"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.NewMetastore(ctx, "this", &databricks.MetastoreArgs{
Name: pulumi.String("primary"),
StorageRoot: pulumi.Sprintf("s3://%v/metastore", metastore.Id),
Owner: pulumi.String("uc admins"),
Region: pulumi.String("us-east-1"),
ForceDestroy: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = databricks.NewMetastoreAssignment(ctx, "this", &databricks.MetastoreAssignmentArgs{
MetastoreId: this.ID(),
WorkspaceId: pulumi.Any(workspaceId),
})
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.Metastore("this", new()
{
Name = "primary",
StorageRoot = $"s3://{metastore.Id}/metastore",
Owner = "uc admins",
Region = "us-east-1",
ForceDestroy = true,
});
var thisMetastoreAssignment = new Databricks.MetastoreAssignment("this", new()
{
MetastoreId = @this.Id,
WorkspaceId = workspaceId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.Metastore;
import com.pulumi.databricks.MetastoreArgs;
import com.pulumi.databricks.MetastoreAssignment;
import com.pulumi.databricks.MetastoreAssignmentArgs;
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 Metastore("this", MetastoreArgs.builder()
.name("primary")
.storageRoot(String.format("s3://%s/metastore", metastore.id()))
.owner("uc admins")
.region("us-east-1")
.forceDestroy(true)
.build());
var thisMetastoreAssignment = new MetastoreAssignment("thisMetastoreAssignment", MetastoreAssignmentArgs.builder()
.metastoreId(this_.id())
.workspaceId(workspaceId)
.build());
}
}
resources:
this:
type: databricks:Metastore
properties:
name: primary
storageRoot: s3://${metastore.id}/metastore
owner: uc admins
region: us-east-1
forceDestroy: true
thisMetastoreAssignment:
type: databricks:MetastoreAssignment
name: this
properties:
metastoreId: ${this.id}
workspaceId: ${workspaceId}
Create MetastoreAssignment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MetastoreAssignment(name: string, args: MetastoreAssignmentArgs, opts?: CustomResourceOptions);
@overload
def MetastoreAssignment(resource_name: str,
args: MetastoreAssignmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MetastoreAssignment(resource_name: str,
opts: Optional[ResourceOptions] = None,
metastore_id: Optional[str] = None,
workspace_id: Optional[str] = None,
default_catalog_name: Optional[str] = None)
func NewMetastoreAssignment(ctx *Context, name string, args MetastoreAssignmentArgs, opts ...ResourceOption) (*MetastoreAssignment, error)
public MetastoreAssignment(string name, MetastoreAssignmentArgs args, CustomResourceOptions? opts = null)
public MetastoreAssignment(String name, MetastoreAssignmentArgs args)
public MetastoreAssignment(String name, MetastoreAssignmentArgs args, CustomResourceOptions options)
type: databricks:MetastoreAssignment
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 MetastoreAssignmentArgs
- 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 MetastoreAssignmentArgs
- 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 MetastoreAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetastoreAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MetastoreAssignmentArgs
- 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 metastoreAssignmentResource = new Databricks.MetastoreAssignment("metastoreAssignmentResource", new()
{
MetastoreId = "string",
WorkspaceId = "string",
DefaultCatalogName = "string",
});
example, err := databricks.NewMetastoreAssignment(ctx, "metastoreAssignmentResource", &databricks.MetastoreAssignmentArgs{
MetastoreId: pulumi.String("string"),
WorkspaceId: pulumi.String("string"),
DefaultCatalogName: pulumi.String("string"),
})
var metastoreAssignmentResource = new MetastoreAssignment("metastoreAssignmentResource", MetastoreAssignmentArgs.builder()
.metastoreId("string")
.workspaceId("string")
.defaultCatalogName("string")
.build());
metastore_assignment_resource = databricks.MetastoreAssignment("metastoreAssignmentResource",
metastore_id="string",
workspace_id="string",
default_catalog_name="string")
const metastoreAssignmentResource = new databricks.MetastoreAssignment("metastoreAssignmentResource", {
metastoreId: "string",
workspaceId: "string",
defaultCatalogName: "string",
});
type: databricks:MetastoreAssignment
properties:
defaultCatalogName: string
metastoreId: string
workspaceId: string
MetastoreAssignment 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 MetastoreAssignment resource accepts the following input properties:
- Metastore
Id string - Unique identifier of the parent Metastore
- Workspace
Id string - id of the workspace for the assignment
- Default
Catalog stringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- Metastore
Id string - Unique identifier of the parent Metastore
- Workspace
Id string - id of the workspace for the assignment
- Default
Catalog stringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore
Id String - Unique identifier of the parent Metastore
- workspace
Id String - id of the workspace for the assignment
- default
Catalog StringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore
Id string - Unique identifier of the parent Metastore
- workspace
Id string - id of the workspace for the assignment
- default
Catalog stringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore_
id str - Unique identifier of the parent Metastore
- workspace_
id str - id of the workspace for the assignment
- default_
catalog_ strname - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore
Id String - Unique identifier of the parent Metastore
- workspace
Id String - id of the workspace for the assignment
- default
Catalog StringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
Outputs
All input properties are implicitly available as output properties. Additionally, the MetastoreAssignment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing MetastoreAssignment Resource
Get an existing MetastoreAssignment 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?: MetastoreAssignmentState, opts?: CustomResourceOptions): MetastoreAssignment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
default_catalog_name: Optional[str] = None,
metastore_id: Optional[str] = None,
workspace_id: Optional[str] = None) -> MetastoreAssignment
func GetMetastoreAssignment(ctx *Context, name string, id IDInput, state *MetastoreAssignmentState, opts ...ResourceOption) (*MetastoreAssignment, error)
public static MetastoreAssignment Get(string name, Input<string> id, MetastoreAssignmentState? state, CustomResourceOptions? opts = null)
public static MetastoreAssignment get(String name, Output<String> id, MetastoreAssignmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Default
Catalog stringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- Metastore
Id string - Unique identifier of the parent Metastore
- Workspace
Id string - id of the workspace for the assignment
- Default
Catalog stringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- Metastore
Id string - Unique identifier of the parent Metastore
- Workspace
Id string - id of the workspace for the assignment
- default
Catalog StringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore
Id String - Unique identifier of the parent Metastore
- workspace
Id String - id of the workspace for the assignment
- default
Catalog stringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore
Id string - Unique identifier of the parent Metastore
- workspace
Id string - id of the workspace for the assignment
- default_
catalog_ strname - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore_
id str - Unique identifier of the parent Metastore
- workspace_
id str - id of the workspace for the assignment
- default
Catalog StringName - Default catalog used for this assignment. Please use databricks.DefaultNamespaceSetting instead.
- metastore
Id String - Unique identifier of the parent Metastore
- workspace
Id String - id of the workspace for the assignment
Import
This resource can be imported by combination of workspace id and metastore id:
bash
$ pulumi import databricks:index/metastoreAssignment:MetastoreAssignment this '<workspace_id>|<metastore_id>'
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.