@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
146 lines • 7.08 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.ExternalLocation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > This resource can only be used with a workspace-level provider!
*
* To work with external tables, Unity Catalog introduces two new objects to access and work with external cloud storage:
*
* - databricks.StorageCredential represent authentication methods to access cloud storage (e.g. an IAM role for Amazon S3 or a service principal for Azure Storage). Storage credentials are access-controlled to determine which users can use the credential.
* - `databricks.ExternalLocation` are objects that combine a cloud storage path with a Storage Credential that can be used to access the location.
*
* ## Example Usage
*
* For AWS
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const external = new databricks.StorageCredential("external", {
* name: externalDataAccess.name,
* awsIamRole: {
* roleArn: externalDataAccess.arn,
* },
* comment: "Managed by TF",
* });
* const some = new databricks.ExternalLocation("some", {
* name: "external",
* url: `s3://${externalAwsS3Bucket.id}/some`,
* credentialName: external.id,
* comment: "Managed by TF",
* });
* const someGrants = new databricks.Grants("some", {
* externalLocation: some.id,
* grants: [{
* principal: "Data Engineers",
* privileges: [
* "CREATE_EXTERNAL_TABLE",
* "READ_FILES",
* ],
* }],
* });
* ```
*
* For Azure
*
* ## Import
*
* This resource can be imported by `name`:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/externalLocation:ExternalLocation this <name>
* ```
*/
class ExternalLocation extends pulumi.CustomResource {
/**
* Get an existing ExternalLocation 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 ExternalLocation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ExternalLocation. 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'] === ExternalLocation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessPoint"] = state ? state.accessPoint : undefined;
resourceInputs["browseOnly"] = state ? state.browseOnly : undefined;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["createdBy"] = state ? state.createdBy : undefined;
resourceInputs["credentialId"] = state ? state.credentialId : undefined;
resourceInputs["credentialName"] = state ? state.credentialName : undefined;
resourceInputs["encryptionDetails"] = state ? state.encryptionDetails : undefined;
resourceInputs["fallback"] = state ? state.fallback : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["forceUpdate"] = state ? state.forceUpdate : 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;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["updatedBy"] = state ? state.updatedBy : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.credentialName === undefined) && !opts.urn) {
throw new Error("Missing required property 'credentialName'");
}
if ((!args || args.url === undefined) && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["accessPoint"] = args ? args.accessPoint : undefined;
resourceInputs["comment"] = args ? args.comment : undefined;
resourceInputs["credentialName"] = args ? args.credentialName : undefined;
resourceInputs["encryptionDetails"] = args ? args.encryptionDetails : undefined;
resourceInputs["fallback"] = args ? args.fallback : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["forceUpdate"] = args ? args.forceUpdate : 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;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["browseOnly"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["createdBy"] = undefined /*out*/;
resourceInputs["credentialId"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["updatedBy"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ExternalLocation.__pulumiType, name, resourceInputs, opts);
}
}
exports.ExternalLocation = ExternalLocation;
/** @internal */
ExternalLocation.__pulumiType = 'databricks:index/externalLocation:ExternalLocation';
//# sourceMappingURL=externalLocation.js.map
;