@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
115 lines (114 loc) • 4.89 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* > This resource can only be used with a workspace-level provider!
*
* This resource creates [Personal Access Tokens](https://docs.databricks.com/sql/user/security/personal-access-tokens.html) for the same user that is authenticated with the provider. Most likely you should use databricks.OboToken to create [On-Behalf-Of tokens](https://docs.databricks.com/administration-guide/users-groups/service-principals.html#manage-personal-access-tokens-for-a-service-principal) for a databricks.ServicePrincipal in Databricks workspaces on AWS. Databricks workspaces on other clouds use their own native OAuth token flows.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* // create PAT token to provision entities within workspace
* const pat = new databricks.Token("pat", {
* comment: "Pulumi Provisioning",
* lifetimeSeconds: 8640000,
* });
* export const databricksToken = pat.tokenValue;
* ```
*
* A token can be automatically rotated by taking a dependency on the `timeRotating` resource:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
* import * as time from "@pulumiverse/time";
*
* const _this = new time.Rotating("this", {rotationDays: 30});
* const pat = new databricks.Token("pat", {
* comment: pulumi.interpolate`Pulumi (created: ${_this.rfc3339})`,
* lifetimeSeconds: 60 * 24 * 60 * 60,
* });
* ```
*
* ## Import
*
* !> Importing this resource is not currently supported.
*/
export declare class Token extends pulumi.CustomResource {
/**
* Get an existing Token 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: string, id: pulumi.Input<pulumi.ID>, state?: TokenState, opts?: pulumi.CustomResourceOptions): Token;
/**
* Returns true if the given object is an instance of Token. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Token;
/**
* (String) Comment that will appear on the user’s settings page for this token.
*/
readonly comment: pulumi.Output<string | undefined>;
readonly creationTime: pulumi.Output<number>;
readonly expiryTime: pulumi.Output<number>;
/**
* (Integer) The lifetime of the token, in seconds. If no lifetime is specified, then expire time will be set to maximum allowed by the workspace configuration or platform.
*/
readonly lifetimeSeconds: pulumi.Output<number | undefined>;
readonly tokenId: pulumi.Output<string>;
/**
* **Sensitive** value of the newly-created token.
*/
readonly tokenValue: pulumi.Output<string>;
/**
* Create a Token resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: TokenArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Token resources.
*/
export interface TokenState {
/**
* (String) Comment that will appear on the user’s settings page for this token.
*/
comment?: pulumi.Input<string>;
creationTime?: pulumi.Input<number>;
expiryTime?: pulumi.Input<number>;
/**
* (Integer) The lifetime of the token, in seconds. If no lifetime is specified, then expire time will be set to maximum allowed by the workspace configuration or platform.
*/
lifetimeSeconds?: pulumi.Input<number>;
tokenId?: pulumi.Input<string>;
/**
* **Sensitive** value of the newly-created token.
*/
tokenValue?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Token resource.
*/
export interface TokenArgs {
/**
* (String) Comment that will appear on the user’s settings page for this token.
*/
comment?: pulumi.Input<string>;
creationTime?: pulumi.Input<number>;
expiryTime?: pulumi.Input<number>;
/**
* (Integer) The lifetime of the token, in seconds. If no lifetime is specified, then expire time will be set to maximum allowed by the workspace configuration or platform.
*/
lifetimeSeconds?: pulumi.Input<number>;
tokenId?: pulumi.Input<string>;
}