databricks.getMetastore
Explore with Pulumi AI
Note This data source can only be used with an account-level provider!
Retrieves information about metastore for a given id of databricks.Metastore object, that was created by Pulumi or manually, so that special handling could be applied.
Note If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add depends_on attribute in order to prevent authentication is not configured for provider errors.
Example Usage
MetastoreInfo response for a given metastore id
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const thisMetastore = new databricks.Metastore("this", {
name: "primary",
storageRoot: `s3://${metastore.id}/metastore`,
owner: unityAdminGroup,
forceDestroy: true,
});
const this = databricks.getMetastoreOutput({
metastoreId: thisMetastore.id,
});
export const someMetastore = _this.apply(_this => _this.metastoreInfo);
import pulumi
import pulumi_databricks as databricks
this_metastore = databricks.Metastore("this",
name="primary",
storage_root=f"s3://{metastore['id']}/metastore",
owner=unity_admin_group,
force_destroy=True)
this = databricks.get_metastore_output(metastore_id=this_metastore.id)
pulumi.export("someMetastore", this.metastore_info)
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 {
thisMetastore, err := databricks.NewMetastore(ctx, "this", &databricks.MetastoreArgs{
Name: pulumi.String("primary"),
StorageRoot: pulumi.Sprintf("s3://%v/metastore", metastore.Id),
Owner: pulumi.Any(unityAdminGroup),
ForceDestroy: pulumi.Bool(true),
})
if err != nil {
return err
}
this := databricks.LookupMetastoreOutput(ctx, databricks.GetMetastoreOutputArgs{
MetastoreId: thisMetastore.ID(),
}, nil)
ctx.Export("someMetastore", this.ApplyT(func(this databricks.GetMetastoreResult) (databricks.GetMetastoreMetastoreInfo, error) {
return this.MetastoreInfo, nil
}).(databricks.GetMetastoreMetastoreInfoOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var thisMetastore = new Databricks.Metastore("this", new()
{
Name = "primary",
StorageRoot = $"s3://{metastore.Id}/metastore",
Owner = unityAdminGroup,
ForceDestroy = true,
});
var @this = Databricks.GetMetastore.Invoke(new()
{
MetastoreId = thisMetastore.Id,
});
return new Dictionary<string, object?>
{
["someMetastore"] = @this.Apply(@this => @this.Apply(getMetastoreResult => getMetastoreResult.MetastoreInfo)),
};
});
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.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetMetastoreArgs;
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 thisMetastore = new Metastore("thisMetastore", MetastoreArgs.builder()
.name("primary")
.storageRoot(String.format("s3://%s/metastore", metastore.id()))
.owner(unityAdminGroup)
.forceDestroy(true)
.build());
final var this = DatabricksFunctions.getMetastore(GetMetastoreArgs.builder()
.metastoreId(thisMetastore.id())
.build());
ctx.export("someMetastore", this_.applyValue(this_ -> this_.metastoreInfo()));
}
}
resources:
thisMetastore:
type: databricks:Metastore
name: this
properties:
name: primary
storageRoot: s3://${metastore.id}/metastore
owner: ${unityAdminGroup}
forceDestroy: true
variables:
this:
fn::invoke:
Function: databricks:getMetastore
Arguments:
metastoreId: ${thisMetastore.id}
outputs:
someMetastore: ${this.metastoreInfo}
Related Resources
The following resources are used in the same context:
- databricks.getMetastores to get mapping of name to id of all metastores.
- databricks.Metastore to manage Metastores within Unity Catalog.
- databricks.Catalog to manage catalogs within Unity Catalog.
Using getMetastore
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 getMetastore(args: GetMetastoreArgs, opts?: InvokeOptions): Promise<GetMetastoreResult>
function getMetastoreOutput(args: GetMetastoreOutputArgs, opts?: InvokeOptions): Output<GetMetastoreResult>
def get_metastore(id: Optional[str] = None,
metastore_id: Optional[str] = None,
metastore_info: Optional[GetMetastoreMetastoreInfo] = None,
name: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetMetastoreResult
def get_metastore_output(id: Optional[pulumi.Input[str]] = None,
metastore_id: Optional[pulumi.Input[str]] = None,
metastore_info: Optional[pulumi.Input[GetMetastoreMetastoreInfoArgs]] = None,
name: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetMetastoreResult]
func LookupMetastore(ctx *Context, args *LookupMetastoreArgs, opts ...InvokeOption) (*LookupMetastoreResult, error)
func LookupMetastoreOutput(ctx *Context, args *LookupMetastoreOutputArgs, opts ...InvokeOption) LookupMetastoreResultOutput
> Note: This function is named LookupMetastore
in the Go SDK.
public static class GetMetastore
{
public static Task<GetMetastoreResult> InvokeAsync(GetMetastoreArgs args, InvokeOptions? opts = null)
public static Output<GetMetastoreResult> Invoke(GetMetastoreInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetMetastoreResult> getMetastore(GetMetastoreArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: databricks:index/getMetastore:getMetastore
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- ID of the metastore
- Metastore
Id string - ID of the metastore
- Metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- Name string
- Name of the metastore
- Region string
- Region of the metastore
- Id string
- ID of the metastore
- Metastore
Id string - ID of the metastore
- Metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- Name string
- Name of the metastore
- Region string
- Region of the metastore
- id String
- ID of the metastore
- metastore
Id String - ID of the metastore
- metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name String
- Name of the metastore
- region String
- Region of the metastore
- id string
- ID of the metastore
- metastore
Id string - ID of the metastore
- metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name string
- Name of the metastore
- region string
- Region of the metastore
- id str
- ID of the metastore
- metastore_
id str - ID of the metastore
- metastore_
info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name str
- Name of the metastore
- region str
- Region of the metastore
- id String
- ID of the metastore
- metastore
Id String - ID of the metastore
- metastore
Info Property Map - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name String
- Name of the metastore
- region String
- Region of the metastore
getMetastore Result
The following output properties are available:
- Id string
- ID of the metastore
- Metastore
Id string - Metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- Name string
- Name of metastore.
- Region string
- Id string
- ID of the metastore
- Metastore
Id string - Metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- Name string
- Name of metastore.
- Region string
- id String
- ID of the metastore
- metastore
Id String - metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name String
- Name of metastore.
- region String
- id string
- ID of the metastore
- metastore
Id string - metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name string
- Name of metastore.
- region string
- id str
- ID of the metastore
- metastore_
id str - metastore_
info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name str
- Name of metastore.
- region str
- id String
- ID of the metastore
- metastore
Id String - metastore
Info Property Map - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name String
- Name of metastore.
- region String
Supporting Types
GetMetastoreMetastoreInfo
- Cloud string
- Created
At int - Created
By string - Default
Data stringAccess Config Id - Delta
Sharing stringOrganization Name - The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
- Delta
Sharing intRecipient Token Lifetime In Seconds - Used to set expiration duration in seconds on recipient data access tokens.
- Delta
Sharing stringScope - Used to enable delta sharing on the metastore. Valid values: INTERNAL, INTERNAL_AND_EXTERNAL. INTERNAL only allows sharing within the same account, and INTERNAL_AND_EXTERNAL allows cross account sharing and token based sharing.
- Global
Metastore stringId - Metastore
Id string - ID of the metastore
- Name string
- Name of the metastore
- Owner string
- Username/groupname/sp application_id of the metastore owner.
- Privilege
Model stringVersion - Region string
- Region of the metastore
- Storage
Root string - Path on cloud storage account, where managed
databricks.Table
are stored. - Storage
Root stringCredential Id - Storage
Root stringCredential Name - Updated
At int - Updated
By string
- Cloud string
- Created
At int - Created
By string - Default
Data stringAccess Config Id - Delta
Sharing stringOrganization Name - The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
- Delta
Sharing intRecipient Token Lifetime In Seconds - Used to set expiration duration in seconds on recipient data access tokens.
- Delta
Sharing stringScope - Used to enable delta sharing on the metastore. Valid values: INTERNAL, INTERNAL_AND_EXTERNAL. INTERNAL only allows sharing within the same account, and INTERNAL_AND_EXTERNAL allows cross account sharing and token based sharing.
- Global
Metastore stringId - Metastore
Id string - ID of the metastore
- Name string
- Name of the metastore
- Owner string
- Username/groupname/sp application_id of the metastore owner.
- Privilege
Model stringVersion - Region string
- Region of the metastore
- Storage
Root string - Path on cloud storage account, where managed
databricks.Table
are stored. - Storage
Root stringCredential Id - Storage
Root stringCredential Name - Updated
At int - Updated
By string
- cloud String
- created
At Integer - created
By String - default
Data StringAccess Config Id - delta
Sharing StringOrganization Name - The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
- delta
Sharing IntegerRecipient Token Lifetime In Seconds - Used to set expiration duration in seconds on recipient data access tokens.
- delta
Sharing StringScope - Used to enable delta sharing on the metastore. Valid values: INTERNAL, INTERNAL_AND_EXTERNAL. INTERNAL only allows sharing within the same account, and INTERNAL_AND_EXTERNAL allows cross account sharing and token based sharing.
- global
Metastore StringId - metastore
Id String - ID of the metastore
- name String
- Name of the metastore
- owner String
- Username/groupname/sp application_id of the metastore owner.
- privilege
Model StringVersion - region String
- Region of the metastore
- storage
Root String - Path on cloud storage account, where managed
databricks.Table
are stored. - storage
Root StringCredential Id - storage
Root StringCredential Name - updated
At Integer - updated
By String
- cloud string
- created
At number - created
By string - default
Data stringAccess Config Id - delta
Sharing stringOrganization Name - The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
- delta
Sharing numberRecipient Token Lifetime In Seconds - Used to set expiration duration in seconds on recipient data access tokens.
- delta
Sharing stringScope - Used to enable delta sharing on the metastore. Valid values: INTERNAL, INTERNAL_AND_EXTERNAL. INTERNAL only allows sharing within the same account, and INTERNAL_AND_EXTERNAL allows cross account sharing and token based sharing.
- global
Metastore stringId - metastore
Id string - ID of the metastore
- name string
- Name of the metastore
- owner string
- Username/groupname/sp application_id of the metastore owner.
- privilege
Model stringVersion - region string
- Region of the metastore
- storage
Root string - Path on cloud storage account, where managed
databricks.Table
are stored. - storage
Root stringCredential Id - storage
Root stringCredential Name - updated
At number - updated
By string
- cloud str
- created_
at int - created_
by str - default_
data_ straccess_ config_ id - delta_
sharing_ strorganization_ name - The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
- delta_
sharing_ intrecipient_ token_ lifetime_ in_ seconds - Used to set expiration duration in seconds on recipient data access tokens.
- delta_
sharing_ strscope - Used to enable delta sharing on the metastore. Valid values: INTERNAL, INTERNAL_AND_EXTERNAL. INTERNAL only allows sharing within the same account, and INTERNAL_AND_EXTERNAL allows cross account sharing and token based sharing.
- global_
metastore_ strid - metastore_
id str - ID of the metastore
- name str
- Name of the metastore
- owner str
- Username/groupname/sp application_id of the metastore owner.
- privilege_
model_ strversion - region str
- Region of the metastore
- storage_
root str - Path on cloud storage account, where managed
databricks.Table
are stored. - storage_
root_ strcredential_ id - storage_
root_ strcredential_ name - updated_
at int - updated_
by str
- cloud String
- created
At Number - created
By String - default
Data StringAccess Config Id - delta
Sharing StringOrganization Name - The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
- delta
Sharing NumberRecipient Token Lifetime In Seconds - Used to set expiration duration in seconds on recipient data access tokens.
- delta
Sharing StringScope - Used to enable delta sharing on the metastore. Valid values: INTERNAL, INTERNAL_AND_EXTERNAL. INTERNAL only allows sharing within the same account, and INTERNAL_AND_EXTERNAL allows cross account sharing and token based sharing.
- global
Metastore StringId - metastore
Id String - ID of the metastore
- name String
- Name of the metastore
- owner String
- Username/groupname/sp application_id of the metastore owner.
- privilege
Model StringVersion - region String
- Region of the metastore
- storage
Root String - Path on cloud storage account, where managed
databricks.Table
are stored. - storage
Root StringCredential Id - storage
Root StringCredential Name - updated
At Number - updated
By String
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricks
Terraform Provider.