@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
168 lines • 6.89 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.getClustersOutput = exports.getClusters = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > **Note** If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add dependsOn attribute in order to prevent _default auth: cannot configure default credentials_ errors.
*
* Retrieves a list of databricks.Cluster ids, that were created by Pulumi or manually, with or without databricks_cluster_policy.
*
* ## Example Usage
*
* Retrieve cluster IDs for all clusters:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const all = databricks.getClusters({});
* ```
*
* Retrieve cluster IDs for all clusters having "Shared" in the cluster name:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const allShared = databricks.getClusters({
* clusterNameContains: "shared",
* });
* ```
*
* ### Filtering clusters
*
* Listing clusters can be slow for workspaces containing many clusters. Use filters to limit the number of clusters returned for better performance. You can filter clusters by state, source, policy, or pinned status:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const allRunningClusters = databricks.getClusters({
* filterBy: {
* clusterStates: ["RUNNING"],
* },
* });
* const allClustersWithPolicy = databricks.getClusters({
* filterBy: {
* policyId: "1234-5678-9012",
* },
* });
* const allApiClusters = databricks.getClusters({
* filterBy: {
* clusterSources: ["API"],
* },
* });
* const allPinnedClusters = databricks.getClusters({
* filterBy: {
* isPinned: true,
* },
* });
* ```
*
* ## Related Resources
*
* The following resources are 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 [Delta Live Tables](https://docs.databricks.com/data-engineering/delta-live-tables/index.html).
*/
function getClusters(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("databricks:index/getClusters:getClusters", {
"clusterNameContains": args.clusterNameContains,
"filterBy": args.filterBy,
"id": args.id,
"ids": args.ids,
}, opts);
}
exports.getClusters = getClusters;
/**
* > **Note** If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add dependsOn attribute in order to prevent _default auth: cannot configure default credentials_ errors.
*
* Retrieves a list of databricks.Cluster ids, that were created by Pulumi or manually, with or without databricks_cluster_policy.
*
* ## Example Usage
*
* Retrieve cluster IDs for all clusters:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const all = databricks.getClusters({});
* ```
*
* Retrieve cluster IDs for all clusters having "Shared" in the cluster name:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const allShared = databricks.getClusters({
* clusterNameContains: "shared",
* });
* ```
*
* ### Filtering clusters
*
* Listing clusters can be slow for workspaces containing many clusters. Use filters to limit the number of clusters returned for better performance. You can filter clusters by state, source, policy, or pinned status:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const allRunningClusters = databricks.getClusters({
* filterBy: {
* clusterStates: ["RUNNING"],
* },
* });
* const allClustersWithPolicy = databricks.getClusters({
* filterBy: {
* policyId: "1234-5678-9012",
* },
* });
* const allApiClusters = databricks.getClusters({
* filterBy: {
* clusterSources: ["API"],
* },
* });
* const allPinnedClusters = databricks.getClusters({
* filterBy: {
* isPinned: true,
* },
* });
* ```
*
* ## Related Resources
*
* The following resources are 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 [Delta Live Tables](https://docs.databricks.com/data-engineering/delta-live-tables/index.html).
*/
function getClustersOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("databricks:index/getClusters:getClusters", {
"clusterNameContains": args.clusterNameContains,
"filterBy": args.filterBy,
"id": args.id,
"ids": args.ids,
}, opts);
}
exports.getClustersOutput = getClustersOutput;
//# sourceMappingURL=getClusters.js.map
;