UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

133 lines 5.66 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** 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. * * hcl * * import { * * to = databricks_metastore_data_access.this * * id = "<metastore_id>|<name>" * * } * * Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command: * * 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, { ...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?.awsIamRole; resourceInputs["azureManagedIdentity"] = state?.azureManagedIdentity; resourceInputs["azureServicePrincipal"] = state?.azureServicePrincipal; resourceInputs["cloudflareApiToken"] = state?.cloudflareApiToken; resourceInputs["comment"] = state?.comment; resourceInputs["databricksGcpServiceAccount"] = state?.databricksGcpServiceAccount; resourceInputs["forceDestroy"] = state?.forceDestroy; resourceInputs["forceUpdate"] = state?.forceUpdate; resourceInputs["gcpServiceAccountKey"] = state?.gcpServiceAccountKey; resourceInputs["isDefault"] = state?.isDefault; resourceInputs["isolationMode"] = state?.isolationMode; resourceInputs["metastoreId"] = state?.metastoreId; resourceInputs["name"] = state?.name; resourceInputs["owner"] = state?.owner; resourceInputs["readOnly"] = state?.readOnly; resourceInputs["skipValidation"] = state?.skipValidation; } else { const args = argsOrState; resourceInputs["awsIamRole"] = args?.awsIamRole; resourceInputs["azureManagedIdentity"] = args?.azureManagedIdentity; resourceInputs["azureServicePrincipal"] = args?.azureServicePrincipal; resourceInputs["cloudflareApiToken"] = args?.cloudflareApiToken; resourceInputs["comment"] = args?.comment; resourceInputs["databricksGcpServiceAccount"] = args?.databricksGcpServiceAccount; resourceInputs["forceDestroy"] = args?.forceDestroy; resourceInputs["forceUpdate"] = args?.forceUpdate; resourceInputs["gcpServiceAccountKey"] = args?.gcpServiceAccountKey; resourceInputs["isDefault"] = args?.isDefault; resourceInputs["isolationMode"] = args?.isolationMode; resourceInputs["metastoreId"] = args?.metastoreId; resourceInputs["name"] = args?.name; resourceInputs["owner"] = args?.owner; resourceInputs["readOnly"] = args?.readOnly; resourceInputs["skipValidation"] = args?.skipValidation; } 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