@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
175 lines (174 loc) • 7.09 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* 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).
*/
export declare function getCluster(args?: GetClusterArgs, opts?: pulumi.InvokeOptions): Promise<GetClusterResult>;
/**
* A collection of arguments for invoking getCluster.
*/
export interface GetClusterArgs {
/**
* The id of the cluster.
*/
clusterId?: string;
/**
* block, consisting of following fields:
*/
clusterInfo?: inputs.GetClusterClusterInfo;
/**
* The exact name of the cluster to search. Can only be specified if there is exactly one cluster with the provided name.
*/
clusterName?: string;
/**
* cluster ID
*/
id?: string;
/**
* Configure the provider for management through account provider. This block consists of the following fields:
*/
providerConfig?: inputs.GetClusterProviderConfig;
}
/**
* A collection of values returned by getCluster.
*/
export interface GetClusterResult {
readonly clusterId: string;
/**
* block, consisting of following fields:
*/
readonly clusterInfo: outputs.GetClusterClusterInfo;
/**
* Cluster name, which doesn’t have to be unique.
*/
readonly clusterName: string;
/**
* cluster ID
*/
readonly id: string;
readonly providerConfig?: outputs.GetClusterProviderConfig;
}
/**
* 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).
*/
export declare function getClusterOutput(args?: GetClusterOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetClusterResult>;
/**
* A collection of arguments for invoking getCluster.
*/
export interface GetClusterOutputArgs {
/**
* The id of the cluster.
*/
clusterId?: pulumi.Input<string>;
/**
* block, consisting of following fields:
*/
clusterInfo?: pulumi.Input<inputs.GetClusterClusterInfoArgs>;
/**
* The exact name of the cluster to search. Can only be specified if there is exactly one cluster with the provided name.
*/
clusterName?: pulumi.Input<string>;
/**
* cluster ID
*/
id?: pulumi.Input<string>;
/**
* Configure the provider for management through account provider. This block consists of the following fields:
*/
providerConfig?: pulumi.Input<inputs.GetClusterProviderConfigArgs>;
}