@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
132 lines • 6.12 kB
JavaScript
;
// *** 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.getClusterOutput = exports.getCluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Retrieves information about a databricks.Cluster using its id. This could be retrieved programmatically using databricks.getClusters data source.
*
* > This data source can only be used with a workspace-level provider!
*
* ## Example Usage
*
* Retrieve attributes of each SQL warehouses in a workspace
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const all = databricks.getClusters({});
* const allGetCluster = all.then(all => .reduce((__obj, [__key, __value]) => ({ ...__obj, [__key]: databricks.getCluster({
* clusterId: __value,
* }) })));
* ```
*
* ### Multiple clusters with the same name
*
* When fetching a cluster whose name is not unique (including terminated but not permanently deleted clusters), you must use the `clusterId` argument to uniquely identify the cluster. Combine this data source with `databricks.getClusters` to get the `clusterId` of the cluster you want to fetch.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const myCluster = databricks.getClusters({
* clusterNameContains: "my-cluster",
* filterBy: {
* clusterStates: ["RUNNING"],
* },
* });
* const myClusterGetCluster = myCluster.then(myCluster => databricks.getCluster({
* clusterId: myCluster.ids?.[0],
* }));
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * End to end workspace management guide.
* * databricks.Cluster to create [Databricks Clusters](https://docs.databricks.com/clusters/index.html).
* * databricks.ClusterPolicy to create a databricks.Cluster policy, which limits the ability to create clusters based on a set of rules.
* * databricks.InstancePool 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.
* * databricks.Job to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code in a databricks_cluster.
* * databricks.Library to install a [library](https://docs.databricks.com/libraries/index.html) on databricks_cluster.
* * databricks.Pipeline to deploy [Lakeflow Declarative Pipelines](https://docs.databricks.com/aws/en/dlt).
*/
function getCluster(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("databricks:index/getCluster:getCluster", {
"clusterId": args.clusterId,
"clusterInfo": args.clusterInfo,
"clusterName": args.clusterName,
"id": args.id,
"providerConfig": args.providerConfig,
}, opts);
}
exports.getCluster = getCluster;
/**
* Retrieves information about a databricks.Cluster using its id. This could be retrieved programmatically using databricks.getClusters data source.
*
* > This data source can only be used with a workspace-level provider!
*
* ## Example Usage
*
* Retrieve attributes of each SQL warehouses in a workspace
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const all = databricks.getClusters({});
* const allGetCluster = all.then(all => .reduce((__obj, [__key, __value]) => ({ ...__obj, [__key]: databricks.getCluster({
* clusterId: __value,
* }) })));
* ```
*
* ### Multiple clusters with the same name
*
* When fetching a cluster whose name is not unique (including terminated but not permanently deleted clusters), you must use the `clusterId` argument to uniquely identify the cluster. Combine this data source with `databricks.getClusters` to get the `clusterId` of the cluster you want to fetch.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const myCluster = databricks.getClusters({
* clusterNameContains: "my-cluster",
* filterBy: {
* clusterStates: ["RUNNING"],
* },
* });
* const myClusterGetCluster = myCluster.then(myCluster => databricks.getCluster({
* clusterId: myCluster.ids?.[0],
* }));
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * End to end workspace management guide.
* * databricks.Cluster to create [Databricks Clusters](https://docs.databricks.com/clusters/index.html).
* * databricks.ClusterPolicy to create a databricks.Cluster policy, which limits the ability to create clusters based on a set of rules.
* * databricks.InstancePool 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.
* * databricks.Job to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code in a databricks_cluster.
* * databricks.Library to install a [library](https://docs.databricks.com/libraries/index.html) on databricks_cluster.
* * databricks.Pipeline to deploy [Lakeflow Declarative Pipelines](https://docs.databricks.com/aws/en/dlt).
*/
function getClusterOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("databricks:index/getCluster:getCluster", {
"clusterId": args.clusterId,
"clusterInfo": args.clusterInfo,
"clusterName": args.clusterName,
"id": args.id,
"providerConfig": args.providerConfig,
}, opts);
}
exports.getClusterOutput = getClusterOutput;
//# sourceMappingURL=getCluster.js.map