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.
This data source can only be used with an account-level provider!
Example Usage
MetastoreInfo response for a given metastore id
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as databricks from "@pulumi/databricks";
const metastore = new aws.index.S3Bucket("metastore", {
bucket: `${prefix}-metastore`,
forceDestroy: true,
});
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_aws as aws
import pulumi_databricks as databricks
metastore = aws.index.S3Bucket("metastore",
bucket=f{prefix}-metastore,
force_destroy=True)
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-aws/sdk/v7/go/aws"
"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 {
metastore, err := aws.NewS3Bucket(ctx, "metastore", &aws.S3BucketArgs{
Bucket: fmt.Sprintf("%v-metastore", prefix),
ForceDestroy: true,
})
if err != nil {
return err
}
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 Aws = Pulumi.Aws;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var metastore = new Aws.Index.S3Bucket("metastore", new()
{
Bucket = $"{prefix}-metastore",
ForceDestroy = true,
});
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.aws.S3Bucket;
import com.pulumi.aws.S3BucketArgs;
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 metastore = new S3Bucket("metastore", S3BucketArgs.builder()
.bucket(String.format("%s-metastore", prefix))
.forceDestroy(true)
.build());
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:
metastore:
type: aws:S3Bucket
properties:
bucket: ${prefix}-metastore
forceDestroy: true
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)
public static Output<GetMetastoreResult> getMetastore(GetMetastoreArgs args, InvokeOptions options)
fn::invoke:
function: databricks:index/getMetastore:getMetastore
arguments:
# arguments dictionaryThe 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 - Unique identifier of the metastore.
- Metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- Name string
- Name of metastore.
- Region string
- Cloud region which the metastore serves (e.g.,
us-west-2,westus).
- Id string
- ID of the metastore
- Metastore
Id string - Unique identifier of the metastore.
- Metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- Name string
- Name of metastore.
- Region string
- Cloud region which the metastore serves (e.g.,
us-west-2,westus).
- id String
- ID of the metastore
- metastore
Id String - Unique identifier of the metastore.
- metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name String
- Name of metastore.
- region String
- Cloud region which the metastore serves (e.g.,
us-west-2,westus).
- id string
- ID of the metastore
- metastore
Id string - Unique identifier of the metastore.
- metastore
Info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name string
- Name of metastore.
- region string
- Cloud region which the metastore serves (e.g.,
us-west-2,westus).
- id str
- ID of the metastore
- metastore_
id str - Unique identifier of the metastore.
- metastore_
info GetMetastore Metastore Info - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name str
- Name of metastore.
- region str
- Cloud region which the metastore serves (e.g.,
us-west-2,westus).
- id String
- ID of the metastore
- metastore
Id String - Unique identifier of the metastore.
- metastore
Info Property Map - MetastoreInfo object for a databricks_metastore. This contains the following attributes:
- name String
- Name of metastore.
- region String
- Cloud region which the metastore serves (e.g.,
us-west-2,westus).
Supporting Types
GetMetastoreMetastoreInfo
- Cloud string
- Cloud vendor of the metastore home shard (e.g.,
aws,azure,gcp). - Created
At int - Time at which the metastore was created, in epoch milliseconds.
- Created
By string - Username of metastore creator.
- Default
Data stringAccess Config Id - Unique identifier of the metastore's default data access configuration.
- 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.
- External
Access boolEnabled - Whether to allow non-DBR clients to directly access entities under the metastore.
- Global
Metastore stringId - Globally unique metastore ID across clouds and regions, of the form
cloud:region:metastore_id. - 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 - Privilege model version of the metastore, of the form
major.minor(e.g.,1.0). - Region string
- Region of the metastore
- Storage
Root string - Path on cloud storage account, where managed
databricks.Tableare stored. - Storage
Root stringCredential Id - UUID of storage credential to access the metastore storage_root.
- Storage
Root stringCredential Name - Name of the storage credential to access the metastore storage_root.
- Updated
At int - Time at which the metastore was last modified, in epoch milliseconds.
- Updated
By string - Username of user who last modified the metastore.
- Cloud string
- Cloud vendor of the metastore home shard (e.g.,
aws,azure,gcp). - Created
At int - Time at which the metastore was created, in epoch milliseconds.
- Created
By string - Username of metastore creator.
- Default
Data stringAccess Config Id - Unique identifier of the metastore's default data access configuration.
- 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.
- External
Access boolEnabled - Whether to allow non-DBR clients to directly access entities under the metastore.
- Global
Metastore stringId - Globally unique metastore ID across clouds and regions, of the form
cloud:region:metastore_id. - 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 - Privilege model version of the metastore, of the form
major.minor(e.g.,1.0). - Region string
- Region of the metastore
- Storage
Root string - Path on cloud storage account, where managed
databricks.Tableare stored. - Storage
Root stringCredential Id - UUID of storage credential to access the metastore storage_root.
- Storage
Root stringCredential Name - Name of the storage credential to access the metastore storage_root.
- Updated
At int - Time at which the metastore was last modified, in epoch milliseconds.
- Updated
By string - Username of user who last modified the metastore.
- cloud String
- Cloud vendor of the metastore home shard (e.g.,
aws,azure,gcp). - created
At Integer - Time at which the metastore was created, in epoch milliseconds.
- created
By String - Username of metastore creator.
- default
Data StringAccess Config Id - Unique identifier of the metastore's default data access configuration.
- 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.
- external
Access BooleanEnabled - Whether to allow non-DBR clients to directly access entities under the metastore.
- global
Metastore StringId - Globally unique metastore ID across clouds and regions, of the form
cloud:region:metastore_id. - 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 - Privilege model version of the metastore, of the form
major.minor(e.g.,1.0). - region String
- Region of the metastore
- storage
Root String - Path on cloud storage account, where managed
databricks.Tableare stored. - storage
Root StringCredential Id - UUID of storage credential to access the metastore storage_root.
- storage
Root StringCredential Name - Name of the storage credential to access the metastore storage_root.
- updated
At Integer - Time at which the metastore was last modified, in epoch milliseconds.
- updated
By String - Username of user who last modified the metastore.
- cloud string
- Cloud vendor of the metastore home shard (e.g.,
aws,azure,gcp). - created
At number - Time at which the metastore was created, in epoch milliseconds.
- created
By string - Username of metastore creator.
- default
Data stringAccess Config Id - Unique identifier of the metastore's default data access configuration.
- 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.
- external
Access booleanEnabled - Whether to allow non-DBR clients to directly access entities under the metastore.
- global
Metastore stringId - Globally unique metastore ID across clouds and regions, of the form
cloud:region:metastore_id. - 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 - Privilege model version of the metastore, of the form
major.minor(e.g.,1.0). - region string
- Region of the metastore
- storage
Root string - Path on cloud storage account, where managed
databricks.Tableare stored. - storage
Root stringCredential Id - UUID of storage credential to access the metastore storage_root.
- storage
Root stringCredential Name - Name of the storage credential to access the metastore storage_root.
- updated
At number - Time at which the metastore was last modified, in epoch milliseconds.
- updated
By string - Username of user who last modified the metastore.
- cloud str
- Cloud vendor of the metastore home shard (e.g.,
aws,azure,gcp). - created_
at int - Time at which the metastore was created, in epoch milliseconds.
- created_
by str - Username of metastore creator.
- default_
data_ straccess_ config_ id - Unique identifier of the metastore's default data access configuration.
- 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.
- external_
access_ boolenabled - Whether to allow non-DBR clients to directly access entities under the metastore.
- global_
metastore_ strid - Globally unique metastore ID across clouds and regions, of the form
cloud:region:metastore_id. - 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 - Privilege model version of the metastore, of the form
major.minor(e.g.,1.0). - region str
- Region of the metastore
- storage_
root str - Path on cloud storage account, where managed
databricks.Tableare stored. - storage_
root_ strcredential_ id - UUID of storage credential to access the metastore storage_root.
- storage_
root_ strcredential_ name - Name of the storage credential to access the metastore storage_root.
- updated_
at int - Time at which the metastore was last modified, in epoch milliseconds.
- updated_
by str - Username of user who last modified the metastore.
- cloud String
- Cloud vendor of the metastore home shard (e.g.,
aws,azure,gcp). - created
At Number - Time at which the metastore was created, in epoch milliseconds.
- created
By String - Username of metastore creator.
- default
Data StringAccess Config Id - Unique identifier of the metastore's default data access configuration.
- 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.
- external
Access BooleanEnabled - Whether to allow non-DBR clients to directly access entities under the metastore.
- global
Metastore StringId - Globally unique metastore ID across clouds and regions, of the form
cloud:region:metastore_id. - 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 - Privilege model version of the metastore, of the form
major.minor(e.g.,1.0). - region String
- Region of the metastore
- storage
Root String - Path on cloud storage account, where managed
databricks.Tableare stored. - storage
Root StringCredential Id - UUID of storage credential to access the metastore storage_root.
- storage
Root StringCredential Name - Name of the storage credential to access the metastore storage_root.
- updated
At Number - Time at which the metastore was last modified, in epoch milliseconds.
- updated
By String - Username of user who last modified the metastore.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
