@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
121 lines • 6.07 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetastoreDataAccess = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > This resource can be used with an account or workspace-level provider.
*
* Optionally, each databricks.Metastore can have a default databricks.StorageCredential defined as `databricks.MetastoreDataAccess`. This will be used by Unity Catalog to access data in the root storage location if defined.
*
* ## Example Usage
*
* For AWS
*
* ```typescript
* 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 thisMetastoreDataAccess = new databricks.MetastoreDataAccess("this", {
* metastoreId: _this.id,
* name: metastoreDataAccess.name,
* awsIamRole: {
* roleArn: metastoreDataAccess.arn,
* },
* isDefault: true,
* });
* ```
*
* For Azure using managed identity as credential (recommended)
*
* ## Import
*
* This resource can be imported by combination of metastore id and the data access name.
*
* bash
*
* ```sh
* $ pulumi import databricks:index/metastoreDataAccess:MetastoreDataAccess this '<metastore_id>|<name>'
* ```
*/
class MetastoreDataAccess extends pulumi.CustomResource {
/**
* Get an existing MetastoreDataAccess resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new MetastoreDataAccess(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MetastoreDataAccess. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === MetastoreDataAccess.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["awsIamRole"] = state ? state.awsIamRole : undefined;
resourceInputs["azureManagedIdentity"] = state ? state.azureManagedIdentity : undefined;
resourceInputs["azureServicePrincipal"] = state ? state.azureServicePrincipal : undefined;
resourceInputs["cloudflareApiToken"] = state ? state.cloudflareApiToken : undefined;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["databricksGcpServiceAccount"] = state ? state.databricksGcpServiceAccount : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["forceUpdate"] = state ? state.forceUpdate : undefined;
resourceInputs["gcpServiceAccountKey"] = state ? state.gcpServiceAccountKey : undefined;
resourceInputs["isDefault"] = state ? state.isDefault : undefined;
resourceInputs["isolationMode"] = state ? state.isolationMode : undefined;
resourceInputs["metastoreId"] = state ? state.metastoreId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["readOnly"] = state ? state.readOnly : undefined;
resourceInputs["skipValidation"] = state ? state.skipValidation : undefined;
}
else {
const args = argsOrState;
resourceInputs["awsIamRole"] = args ? args.awsIamRole : undefined;
resourceInputs["azureManagedIdentity"] = args ? args.azureManagedIdentity : undefined;
resourceInputs["azureServicePrincipal"] = args ? args.azureServicePrincipal : undefined;
resourceInputs["cloudflareApiToken"] = args ? args.cloudflareApiToken : undefined;
resourceInputs["comment"] = args ? args.comment : undefined;
resourceInputs["databricksGcpServiceAccount"] = args ? args.databricksGcpServiceAccount : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["forceUpdate"] = args ? args.forceUpdate : undefined;
resourceInputs["gcpServiceAccountKey"] = args ? args.gcpServiceAccountKey : undefined;
resourceInputs["isDefault"] = args ? args.isDefault : undefined;
resourceInputs["isolationMode"] = args ? args.isolationMode : undefined;
resourceInputs["metastoreId"] = args ? args.metastoreId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["readOnly"] = args ? args.readOnly : undefined;
resourceInputs["skipValidation"] = args ? args.skipValidation : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MetastoreDataAccess.__pulumiType, name, resourceInputs, opts);
}
}
exports.MetastoreDataAccess = MetastoreDataAccess;
/** @internal */
MetastoreDataAccess.__pulumiType = 'databricks:index/metastoreDataAccess:MetastoreDataAccess';
//# sourceMappingURL=metastoreDataAccess.js.map
;