Class Cluster
Manages a Cloud Dataproc cluster resource within GCP. For more information see the official dataproc documentation.
!> 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 others will cause recreation of the
whole cluster!
Example Usage - Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var simplecluster = new Gcp.Dataproc.Cluster("simplecluster", new Gcp.Dataproc.ClusterArgs
{
Region = "us-central1",
});
}
}
Example Usage - Advanced
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var mycluster = new Gcp.Dataproc.Cluster("mycluster", new Gcp.Dataproc.ClusterArgs
{
ClusterConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigArgs
{
GceClusterConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigGceClusterConfigArgs
{
ServiceAccountScopes =
{
"https://www.googleapis.com/auth/monitoring",
"useraccounts-ro",
"storage-rw",
"logging-write",
},
Tags =
{
"foo",
"bar",
},
},
InitializationAction =
{
{
{ "script", "gs://dataproc-initialization-actions/stackdriver/stackdriver.sh" },
{ "timeoutSec", 500 },
},
},
MasterConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigMasterConfigArgs
{
DiskConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigMasterConfigDiskConfigArgs
{
BootDiskSizeGb = 15,
BootDiskType = "pd-ssd",
},
MachineType = "n1-standard-1",
NumInstances = 1,
},
PreemptibleWorkerConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigPreemptibleWorkerConfigArgs
{
NumInstances = 0,
},
SoftwareConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigSoftwareConfigArgs
{
ImageVersion = "1.3.7-deb9",
OverrideProperties =
{
{ "dataproc:dataproc.allow.zero.workers", "true" },
},
},
StagingBucket = "dataproc-staging-bucket",
WorkerConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigWorkerConfigArgs
{
DiskConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigWorkerConfigDiskConfigArgs
{
BootDiskSizeGb = 15,
NumLocalSsds = 1,
},
MachineType = "n1-standard-1",
MinCpuPlatform = "Intel Skylake",
NumInstances = 2,
},
},
Labels =
{
{ "foo", "bar" },
},
Region = "us-central1",
});
}
}
Example Usage - Using a GPU accelerator
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var acceleratedCluster = new Gcp.Dataproc.Cluster("acceleratedCluster", new Gcp.Dataproc.ClusterArgs
{
ClusterConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigArgs
{
GceClusterConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigGceClusterConfigArgs
{
Zone = "us-central1-a",
},
MasterConfig = new Gcp.Dataproc.Inputs.ClusterClusterConfigMasterConfigArgs
{
Accelerators =
{
new Gcp.Dataproc.Inputs.ClusterClusterConfigMasterConfigAcceleratorArgs
{
AcceleratorCount = "1",
AcceleratorType = "nvidia-tesla-k80",
},
},
},
},
Region = "us-central1",
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Dataproc
Assembly: Pulumi.Gcp.dll
Syntax
public class Cluster : CustomResource
Constructors
View SourceCluster(String, ClusterArgs, CustomResourceOptions)
Create a Cluster resource with the given unique name, arguments, and options.
Declaration
public Cluster(string name, ClusterArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ClusterArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceClusterConfig
Allows you to configure various aspects of the cluster. Structure defined below.
Declaration
public Output<ClusterClusterConfig> ClusterConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<ClusterClusterConfig> |
Labels
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.
Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
Name
The name of the cluster, unique within the project and zone.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the cluster will exist. If it
is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The region in which the cluster and associated nodes will be created in.
Defaults to global.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ClusterState, CustomResourceOptions)
Get an existing Cluster resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Cluster Get(string name, Input<string> id, ClusterState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ClusterState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Cluster |