@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
131 lines • 7.33 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.InstancePool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to manage [instance pools](https://docs.databricks.com/clusters/instance-pools/index.html) to reduce cluster start and auto-scaling times by maintaining a set of idle, ready-to-use instances. An instance pool reduces cluster start and auto-scaling times by maintaining a set of idle, ready-to-use cloud instances. When a cluster attached to a pool needs an instance, it first attempts to allocate one of the pool’s idle instances. If the pool has no idle instances, it expands by allocating a new instance from the instance provider in order to accommodate the cluster’s request. When a cluster releases an instance, it returns to the pool and is free for another cluster to use. Only clusters attached to a pool can use that pool’s idle instances.
*
* > It is important to know that different cloud service providers have different `nodeTypeId`, `diskSpecs` and potentially other configurations.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const smallest = databricks.getNodeType({});
* const smallestNodes = new databricks.InstancePool("smallest_nodes", {
* instancePoolName: "Smallest Nodes",
* minIdleInstances: 0,
* maxCapacity: 300,
* nodeTypeId: smallest.then(smallest => smallest.id),
* awsAttributes: {
* availability: "ON_DEMAND",
* zoneId: "us-east-1a",
* spotBidPricePercent: 100,
* },
* idleInstanceAutoterminationMinutes: 10,
* diskSpec: {
* diskType: {
* ebsVolumeType: "GENERAL_PURPOSE_SSD",
* },
* diskSize: 80,
* diskCount: 1,
* },
* });
* ```
*
* ## Access Control
*
* * databricks.Group and databricks.User can control which groups or individual users can create instance pools.
* * databricks.Permissions can control which groups or individual users can *Manage* or *Attach to* individual instance pools.
*
* ## Import
*
* The resource instance pool can be imported using it's id:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/instancePool:InstancePool this <instance-pool-id>
* ```
*/
class InstancePool extends pulumi.CustomResource {
/**
* Get an existing InstancePool 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 InstancePool(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of InstancePool. 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'] === InstancePool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["awsAttributes"] = state ? state.awsAttributes : undefined;
resourceInputs["azureAttributes"] = state ? state.azureAttributes : undefined;
resourceInputs["customTags"] = state ? state.customTags : undefined;
resourceInputs["diskSpec"] = state ? state.diskSpec : undefined;
resourceInputs["enableElasticDisk"] = state ? state.enableElasticDisk : undefined;
resourceInputs["gcpAttributes"] = state ? state.gcpAttributes : undefined;
resourceInputs["idleInstanceAutoterminationMinutes"] = state ? state.idleInstanceAutoterminationMinutes : undefined;
resourceInputs["instancePoolFleetAttributes"] = state ? state.instancePoolFleetAttributes : undefined;
resourceInputs["instancePoolId"] = state ? state.instancePoolId : undefined;
resourceInputs["instancePoolName"] = state ? state.instancePoolName : undefined;
resourceInputs["maxCapacity"] = state ? state.maxCapacity : undefined;
resourceInputs["minIdleInstances"] = state ? state.minIdleInstances : undefined;
resourceInputs["nodeTypeId"] = state ? state.nodeTypeId : undefined;
resourceInputs["preloadedDockerImages"] = state ? state.preloadedDockerImages : undefined;
resourceInputs["preloadedSparkVersions"] = state ? state.preloadedSparkVersions : undefined;
}
else {
const args = argsOrState;
if ((!args || args.idleInstanceAutoterminationMinutes === undefined) && !opts.urn) {
throw new Error("Missing required property 'idleInstanceAutoterminationMinutes'");
}
if ((!args || args.instancePoolName === undefined) && !opts.urn) {
throw new Error("Missing required property 'instancePoolName'");
}
resourceInputs["awsAttributes"] = args ? args.awsAttributes : undefined;
resourceInputs["azureAttributes"] = args ? args.azureAttributes : undefined;
resourceInputs["customTags"] = args ? args.customTags : undefined;
resourceInputs["diskSpec"] = args ? args.diskSpec : undefined;
resourceInputs["enableElasticDisk"] = args ? args.enableElasticDisk : undefined;
resourceInputs["gcpAttributes"] = args ? args.gcpAttributes : undefined;
resourceInputs["idleInstanceAutoterminationMinutes"] = args ? args.idleInstanceAutoterminationMinutes : undefined;
resourceInputs["instancePoolFleetAttributes"] = args ? args.instancePoolFleetAttributes : undefined;
resourceInputs["instancePoolId"] = args ? args.instancePoolId : undefined;
resourceInputs["instancePoolName"] = args ? args.instancePoolName : undefined;
resourceInputs["maxCapacity"] = args ? args.maxCapacity : undefined;
resourceInputs["minIdleInstances"] = args ? args.minIdleInstances : undefined;
resourceInputs["nodeTypeId"] = args ? args.nodeTypeId : undefined;
resourceInputs["preloadedDockerImages"] = args ? args.preloadedDockerImages : undefined;
resourceInputs["preloadedSparkVersions"] = args ? args.preloadedSparkVersions : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstancePool.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstancePool = InstancePool;
/** @internal */
InstancePool.__pulumiType = 'databricks:index/instancePool:InstancePool';
//# sourceMappingURL=instancePool.js.map
;