@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
109 lines • 5.88 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.Secret = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* With this resource you can insert a secret under the provided scope with the given name. If a secret already exists with the same name, this command overwrites the existing secret’s value. The server encrypts the secret using the secret scope’s encryption settings before storing it. You must have WRITE or MANAGE permission on the secret scope. The secret key must consist of alphanumeric characters, dashes, underscores, and periods, and cannot exceed 128 characters. The maximum allowed secret value size is 128 KB. The maximum number of secrets in a given scope is 1000. You can read a secret value only from within a command on a cluster (for example, through a notebook); there is no API to read a secret value outside of a cluster. The permission applied is based on who is invoking the command and you must have at least READ permission. Please consult [Secrets User Guide](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) for more details.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const app = new databricks.SecretScope("app", {name: "application-secret-scope"});
* const publishingApi = new databricks.Secret("publishing_api", {
* key: "publishing_api",
* stringValue: example.value,
* scope: app.id,
* });
* const _this = new databricks.Cluster("this", {sparkConf: {
* "fs.azure.account.oauth2.client.secret": publishingApi.configReference,
* }});
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * End to end workspace management guide.
* * databricks.Notebook to manage [Databricks Notebooks](https://docs.databricks.com/notebooks/index.html).
* * databricks.Pipeline to deploy [Delta Live Tables](https://docs.databricks.com/data-engineering/delta-live-tables/index.html).
* * databricks.Repo to manage [Databricks Repos](https://docs.databricks.com/repos.html).
* * databricks.SecretAcl to manage access to [secrets](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace.
* * databricks.SecretScope to create [secret scopes](https://docs.databricks.com/security/secrets/index.html#secrets-user-guide) in Databricks workspace.
*
* ## Import
*
* The resource secret can be imported using `scopeName|||secretKey` combination. **This may change in future versions.**
*
* bash
*
* ```sh
* $ pulumi import databricks:index/secret:Secret app `scopeName|||secretKey`
* ```
*/
class Secret extends pulumi.CustomResource {
/**
* Get an existing Secret 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 Secret(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Secret. 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'] === Secret.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["configReference"] = state ? state.configReference : undefined;
resourceInputs["key"] = state ? state.key : undefined;
resourceInputs["lastUpdatedTimestamp"] = state ? state.lastUpdatedTimestamp : undefined;
resourceInputs["scope"] = state ? state.scope : undefined;
resourceInputs["stringValue"] = state ? state.stringValue : undefined;
}
else {
const args = argsOrState;
if ((!args || args.key === undefined) && !opts.urn) {
throw new Error("Missing required property 'key'");
}
if ((!args || args.scope === undefined) && !opts.urn) {
throw new Error("Missing required property 'scope'");
}
if ((!args || args.stringValue === undefined) && !opts.urn) {
throw new Error("Missing required property 'stringValue'");
}
resourceInputs["key"] = args ? args.key : undefined;
resourceInputs["scope"] = args ? args.scope : undefined;
resourceInputs["stringValue"] = (args === null || args === void 0 ? void 0 : args.stringValue) ? pulumi.secret(args.stringValue) : undefined;
resourceInputs["configReference"] = undefined /*out*/;
resourceInputs["lastUpdatedTimestamp"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["stringValue"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Secret.__pulumiType, name, resourceInputs, opts);
}
}
exports.Secret = Secret;
/** @internal */
Secret.__pulumiType = 'databricks:index/secret:Secret';
//# sourceMappingURL=secret.js.map
;