UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

160 lines 6.75 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.ExternalLocation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * 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. * * > This resource can only be used with a workspace-level provider! * * ## 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`: * * hcl * * import { * * to = databricks_external_location.this * * id = "<name>" * * } * * Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command: * * 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, { ...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["browseOnly"] = state?.browseOnly; resourceInputs["comment"] = state?.comment; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["createdBy"] = state?.createdBy; resourceInputs["credentialId"] = state?.credentialId; resourceInputs["credentialName"] = state?.credentialName; resourceInputs["enableFileEvents"] = state?.enableFileEvents; resourceInputs["encryptionDetails"] = state?.encryptionDetails; resourceInputs["fallback"] = state?.fallback; resourceInputs["fileEventQueue"] = state?.fileEventQueue; resourceInputs["forceDestroy"] = state?.forceDestroy; resourceInputs["forceUpdate"] = state?.forceUpdate; resourceInputs["isolationMode"] = state?.isolationMode; resourceInputs["metastoreId"] = state?.metastoreId; resourceInputs["name"] = state?.name; resourceInputs["owner"] = state?.owner; resourceInputs["readOnly"] = state?.readOnly; resourceInputs["skipValidation"] = state?.skipValidation; resourceInputs["updatedAt"] = state?.updatedAt; resourceInputs["updatedBy"] = state?.updatedBy; resourceInputs["url"] = state?.url; } else { const args = argsOrState; if (args?.credentialName === undefined && !opts.urn) { throw new Error("Missing required property 'credentialName'"); } if (args?.url === undefined && !opts.urn) { throw new Error("Missing required property 'url'"); } resourceInputs["comment"] = args?.comment; resourceInputs["credentialName"] = args?.credentialName; resourceInputs["enableFileEvents"] = args?.enableFileEvents; resourceInputs["encryptionDetails"] = args?.encryptionDetails; resourceInputs["fallback"] = args?.fallback; resourceInputs["fileEventQueue"] = args?.fileEventQueue; resourceInputs["forceDestroy"] = args?.forceDestroy; resourceInputs["forceUpdate"] = args?.forceUpdate; resourceInputs["isolationMode"] = args?.isolationMode; resourceInputs["metastoreId"] = args?.metastoreId; resourceInputs["name"] = args?.name; resourceInputs["owner"] = args?.owner; resourceInputs["readOnly"] = args?.readOnly; resourceInputs["skipValidation"] = args?.skipValidation; resourceInputs["url"] = args?.url; 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