1. Packages
  2. Databricks
  3. API Docs
  4. getMetastore
Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi

databricks.getMetastore

Explore with Pulumi AI

databricks logo
Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi

    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.String(fmt.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}
    

    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(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(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:

    MetastoreId string
    Id of the metastore
    MetastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    Name string
    Name of the metastore
    Region string
    Region of the metastore
    MetastoreId string
    Id of the metastore
    MetastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    Name string
    Name of the metastore
    Region string
    Region of the metastore
    metastoreId String
    Id of the metastore
    metastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    name String
    Name of the metastore
    region String
    Region of the metastore
    metastoreId string
    Id of the metastore
    metastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    name string
    Name of the metastore
    region string
    Region of the metastore
    metastore_id str
    Id of the metastore
    metastore_info GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    name str
    Name of the metastore
    region str
    Region of the metastore
    metastoreId String
    Id of the metastore
    metastoreInfo 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
    The provider-assigned unique ID for this managed resource.
    MetastoreId string
    MetastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    Name string
    Name of metastore.
    Region string
    Id string
    The provider-assigned unique ID for this managed resource.
    MetastoreId string
    MetastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    Name string
    Name of metastore.
    Region string
    id String
    The provider-assigned unique ID for this managed resource.
    metastoreId String
    metastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    name String
    Name of metastore.
    region String
    id string
    The provider-assigned unique ID for this managed resource.
    metastoreId string
    metastoreInfo GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    name string
    Name of metastore.
    region string
    id str
    The provider-assigned unique ID for this managed resource.
    metastore_id str
    metastore_info GetMetastoreMetastoreInfo
    MetastoreInfo object for a databricks_metastore. This contains the following attributes:
    name str
    Name of metastore.
    region str
    id String
    The provider-assigned unique ID for this managed resource.
    metastoreId String
    metastoreInfo 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
    CreatedAt int
    CreatedBy string
    DefaultDataAccessConfigId string
    DeltaSharingOrganizationName string
    The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
    DeltaSharingRecipientTokenLifetimeInSeconds int
    Used to set expiration duration in seconds on recipient data access tokens.
    DeltaSharingScope string
    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.
    GlobalMetastoreId string
    MetastoreId string
    Id of the metastore
    Name string
    Name of the metastore
    Owner string
    Username/groupname/sp application_id of the metastore owner.
    PrivilegeModelVersion string
    Region string
    Region of the metastore
    StorageRoot string
    Path on cloud storage account, where managed databricks.Table are stored.
    StorageRootCredentialId string
    StorageRootCredentialName string
    UpdatedAt int
    UpdatedBy string
    Cloud string
    CreatedAt int
    CreatedBy string
    DefaultDataAccessConfigId string
    DeltaSharingOrganizationName string
    The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
    DeltaSharingRecipientTokenLifetimeInSeconds int
    Used to set expiration duration in seconds on recipient data access tokens.
    DeltaSharingScope string
    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.
    GlobalMetastoreId string
    MetastoreId string
    Id of the metastore
    Name string
    Name of the metastore
    Owner string
    Username/groupname/sp application_id of the metastore owner.
    PrivilegeModelVersion string
    Region string
    Region of the metastore
    StorageRoot string
    Path on cloud storage account, where managed databricks.Table are stored.
    StorageRootCredentialId string
    StorageRootCredentialName string
    UpdatedAt int
    UpdatedBy string
    cloud String
    createdAt Integer
    createdBy String
    defaultDataAccessConfigId String
    deltaSharingOrganizationName String
    The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
    deltaSharingRecipientTokenLifetimeInSeconds Integer
    Used to set expiration duration in seconds on recipient data access tokens.
    deltaSharingScope String
    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.
    globalMetastoreId String
    metastoreId String
    Id of the metastore
    name String
    Name of the metastore
    owner String
    Username/groupname/sp application_id of the metastore owner.
    privilegeModelVersion String
    region String
    Region of the metastore
    storageRoot String
    Path on cloud storage account, where managed databricks.Table are stored.
    storageRootCredentialId String
    storageRootCredentialName String
    updatedAt Integer
    updatedBy String
    cloud string
    createdAt number
    createdBy string
    defaultDataAccessConfigId string
    deltaSharingOrganizationName string
    The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
    deltaSharingRecipientTokenLifetimeInSeconds number
    Used to set expiration duration in seconds on recipient data access tokens.
    deltaSharingScope string
    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.
    globalMetastoreId string
    metastoreId string
    Id of the metastore
    name string
    Name of the metastore
    owner string
    Username/groupname/sp application_id of the metastore owner.
    privilegeModelVersion string
    region string
    Region of the metastore
    storageRoot string
    Path on cloud storage account, where managed databricks.Table are stored.
    storageRootCredentialId string
    storageRootCredentialName string
    updatedAt number
    updatedBy string
    cloud str
    created_at int
    created_by str
    default_data_access_config_id str
    delta_sharing_organization_name str
    The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
    delta_sharing_recipient_token_lifetime_in_seconds int
    Used to set expiration duration in seconds on recipient data access tokens.
    delta_sharing_scope str
    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_id str
    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_version str
    region str
    Region of the metastore
    storage_root str
    Path on cloud storage account, where managed databricks.Table are stored.
    storage_root_credential_id str
    storage_root_credential_name str
    updated_at int
    updated_by str
    cloud String
    createdAt Number
    createdBy String
    defaultDataAccessConfigId String
    deltaSharingOrganizationName String
    The organization name of a Delta Sharing entity. This field is used for Databricks to Databricks sharing.
    deltaSharingRecipientTokenLifetimeInSeconds Number
    Used to set expiration duration in seconds on recipient data access tokens.
    deltaSharingScope String
    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.
    globalMetastoreId String
    metastoreId String
    Id of the metastore
    name String
    Name of the metastore
    owner String
    Username/groupname/sp application_id of the metastore owner.
    privilegeModelVersion String
    region String
    Region of the metastore
    storageRoot String
    Path on cloud storage account, where managed databricks.Table are stored.
    storageRootCredentialId String
    storageRootCredentialName String
    updatedAt Number
    updatedBy String

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi