@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
288 lines (287 loc) • 10.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Manages a Cloud Dataproc cluster resource within GCP.
*
* * [API documentation](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/dataproc/docs)
*
* !> **Warning:** Due to limitations of the API, all arguments except
* `labels`,`cluster_config.worker_config.num_instances` and `cluster_config.preemptible_worker_config.num_instances` are non-updatable. Changing `cluster_config.worker_config.min_num_instances` will be ignored. Changing others will cause recreation of the
* whole cluster!
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const simplecluster = new gcp.dataproc.Cluster("simplecluster", {
* name: "simplecluster",
* region: "us-central1",
* });
* ```
*
* ### Advanced
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.serviceaccount.Account("default", {
* accountId: "service-account-id",
* displayName: "Service Account",
* });
* const mycluster = new gcp.dataproc.Cluster("mycluster", {
* name: "mycluster",
* region: "us-central1",
* gracefulDecommissionTimeout: "120s",
* labels: {
* foo: "bar",
* },
* clusterConfig: {
* stagingBucket: "dataproc-staging-bucket",
* masterConfig: {
* numInstances: 1,
* machineType: "e2-medium",
* diskConfig: {
* bootDiskType: "pd-ssd",
* bootDiskSizeGb: 30,
* },
* },
* workerConfig: {
* numInstances: 2,
* machineType: "e2-medium",
* minCpuPlatform: "Intel Skylake",
* diskConfig: {
* bootDiskSizeGb: 30,
* numLocalSsds: 1,
* },
* },
* preemptibleWorkerConfig: {
* numInstances: 0,
* },
* softwareConfig: {
* imageVersion: "2.0.35-debian10",
* overrideProperties: {
* "dataproc:dataproc.allow.zero.workers": "true",
* },
* },
* gceClusterConfig: {
* tags: [
* "foo",
* "bar",
* ],
* serviceAccount: _default.email,
* serviceAccountScopes: ["cloud-platform"],
* },
* initializationActions: [{
* script: "gs://dataproc-initialization-actions/stackdriver/stackdriver.sh",
* timeoutSec: 500,
* }],
* },
* });
* ```
*
* ### Using A GPU Accelerator
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const acceleratedCluster = new gcp.dataproc.Cluster("accelerated_cluster", {
* name: "my-cluster-with-gpu",
* region: "us-central1",
* clusterConfig: {
* gceClusterConfig: {
* zone: "us-central1-a",
* },
* masterConfig: {
* accelerators: [{
* acceleratorType: "nvidia-tesla-k80",
* acceleratorCount: 1,
* }],
* },
* },
* });
* ```
*
* ## Import
*
* This resource does not support import.
*/
export declare class Cluster extends pulumi.CustomResource {
/**
* Get an existing Cluster 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?: ClusterState, opts?: pulumi.CustomResourceOptions): Cluster;
/**
* Returns true if the given object is an instance of Cluster. 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 Cluster;
/**
* Allows you to configure various aspects of the cluster.
* Structure defined below.
*/
readonly clusterConfig: pulumi.Output<outputs.dataproc.ClusterClusterConfig>;
/**
* The list of labels (key/value pairs) to be applied to
* instances in the cluster. GCP generates some itself including `goog-dataproc-cluster-name`
* which is the name of the cluster.
*/
readonly effectiveLabels: pulumi.Output<{
[key: string]: string;
}>;
readonly gracefulDecommissionTimeout: pulumi.Output<string | undefined>;
/**
* The list of the labels (key/value pairs) configured on the resource and to be applied to instances in the cluster.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer
* to the field 'effective_labels' for all of the labels present on the resource.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The name of the cluster, unique within the project and
* zone.
*
* - - -
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the `cluster` will exist. If it
* is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The combination of labels configured directly on the resource and default labels configured on the provider.
*/
readonly pulumiLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* The region in which the cluster and associated nodes will be created in.
* Defaults to `global`.
*/
readonly region: pulumi.Output<string | undefined>;
/**
* Allows you to configure a virtual Dataproc on GKE cluster.
* Structure defined below.
*/
readonly virtualClusterConfig: pulumi.Output<outputs.dataproc.ClusterVirtualClusterConfig>;
/**
* Create a Cluster 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?: ClusterArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Cluster resources.
*/
export interface ClusterState {
/**
* Allows you to configure various aspects of the cluster.
* Structure defined below.
*/
clusterConfig?: pulumi.Input<inputs.dataproc.ClusterClusterConfig>;
/**
* The list of labels (key/value pairs) to be applied to
* instances in the cluster. GCP generates some itself including `goog-dataproc-cluster-name`
* which is the name of the cluster.
*/
effectiveLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
gracefulDecommissionTimeout?: pulumi.Input<string>;
/**
* The list of the labels (key/value pairs) configured on the resource and to be applied to instances in the cluster.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer
* to the field 'effective_labels' for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The name of the cluster, unique within the project and
* zone.
*
* - - -
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the `cluster` will exist. If it
* is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The combination of labels configured directly on the resource and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The region in which the cluster and associated nodes will be created in.
* Defaults to `global`.
*/
region?: pulumi.Input<string>;
/**
* Allows you to configure a virtual Dataproc on GKE cluster.
* Structure defined below.
*/
virtualClusterConfig?: pulumi.Input<inputs.dataproc.ClusterVirtualClusterConfig>;
}
/**
* The set of arguments for constructing a Cluster resource.
*/
export interface ClusterArgs {
/**
* Allows you to configure various aspects of the cluster.
* Structure defined below.
*/
clusterConfig?: pulumi.Input<inputs.dataproc.ClusterClusterConfig>;
gracefulDecommissionTimeout?: pulumi.Input<string>;
/**
* The list of the labels (key/value pairs) configured on the resource and to be applied to instances in the cluster.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer
* to the field 'effective_labels' for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The name of the cluster, unique within the project and
* zone.
*
* - - -
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the `cluster` will exist. If it
* is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The region in which the cluster and associated nodes will be created in.
* Defaults to `global`.
*/
region?: pulumi.Input<string>;
/**
* Allows you to configure a virtual Dataproc on GKE cluster.
* Structure defined below.
*/
virtualClusterConfig?: pulumi.Input<inputs.dataproc.ClusterVirtualClusterConfig>;
}