@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
94 lines • 4.97 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.ServicePrincipalSecret = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > This resource can only be used with an account-level provider.
*
* With this resource you can create a secret for a given [Service Principals](https://docs.databricks.com/administration-guide/users-groups/service-principals.html).
*
* This secret can be used to configure the Databricks Pulumi Provider to authenticate with the service principal. See Authenticating with service principal.
*
* Additionally, the secret can be used to request OAuth tokens for the service principal, which can be used to authenticate to Databricks REST APIs. See [Authentication using OAuth tokens for service principals](https://docs.databricks.com/dev-tools/authentication-oauth.html).
*
* ## Example Usage
*
* Create service principal secret
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const terraformSp = new databricks.ServicePrincipalSecret("terraform_sp", {servicePrincipalId: _this.id});
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * databricks.ServicePrincipal to manage [Service Principals](https://docs.databricks.com/administration-guide/users-groups/service-principals.html) in Databricks
*/
class ServicePrincipalSecret extends pulumi.CustomResource {
/**
* Get an existing ServicePrincipalSecret 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 ServicePrincipalSecret(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServicePrincipalSecret. 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'] === ServicePrincipalSecret.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["expireTime"] = state ? state.expireTime : undefined;
resourceInputs["lifetime"] = state ? state.lifetime : undefined;
resourceInputs["secret"] = state ? state.secret : undefined;
resourceInputs["secretHash"] = state ? state.secretHash : undefined;
resourceInputs["servicePrincipalId"] = state ? state.servicePrincipalId : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.servicePrincipalId === undefined) && !opts.urn) {
throw new Error("Missing required property 'servicePrincipalId'");
}
resourceInputs["createTime"] = args ? args.createTime : undefined;
resourceInputs["expireTime"] = args ? args.expireTime : undefined;
resourceInputs["lifetime"] = args ? args.lifetime : undefined;
resourceInputs["secret"] = (args === null || args === void 0 ? void 0 : args.secret) ? pulumi.secret(args.secret) : undefined;
resourceInputs["secretHash"] = args ? args.secretHash : undefined;
resourceInputs["servicePrincipalId"] = args ? args.servicePrincipalId : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["updateTime"] = args ? args.updateTime : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["secret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServicePrincipalSecret.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServicePrincipalSecret = ServicePrincipalSecret;
/** @internal */
ServicePrincipalSecret.__pulumiType = 'databricks:index/servicePrincipalSecret:ServicePrincipalSecret';
//# sourceMappingURL=servicePrincipalSecret.js.map