# WorkerConfigurationProperty

Properties for the worker configuration.

- Source: [`aws-stepfunctions-tasks/lib/glue/start-job-run.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/glue/start-job-run.ts#L11)
- Type last changed: v2.173.0 · 12 Dec 2024

## Example

TypeScript:

```ts
new tasks.GlueStartJobRun(this, 'Task', {
  glueJobName: 'my-glue-job',
  workerConfiguration: {
    workerTypeV2: tasks.WorkerTypeV2.G_1X, // Worker type
    numberOfWorkers: 2, // Number of Workers
  },
});
```

Python:

```python
tasks.GlueStartJobRun(self, "Task",
    glue_job_name="my-glue-job",
    worker_configuration=tasks.WorkerConfigurationProperty(
        worker_type_v2=tasks.WorkerTypeV2.G_1X,  # Worker type
        number_of_workers=2
    )
)
```

Java:

```java
GlueStartJobRun.Builder.create(this, "Task")
        .glueJobName("my-glue-job")
        .workerConfiguration(WorkerConfigurationProperty.builder()
                .workerTypeV2(WorkerTypeV2.G_1X) // Worker type
                .numberOfWorkers(2)
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new GlueStartJobRun(this, "Task", new GlueStartJobRunProps {
    GlueJobName = "my-glue-job",
    WorkerConfiguration = new WorkerConfigurationProperty {
        WorkerTypeV2 = WorkerTypeV2.G_1X,  // Worker type
        NumberOfWorkers = 2
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
tasks.NewGlueStartJobRun(this, jsii.String("Task"), &GlueStartJobRunProps{
	GlueJobName: jsii.String("my-glue-job"),
	WorkerConfiguration: &WorkerConfigurationProperty{
		WorkerTypeV2: tasks.WorkerTypeV2_G_1X(),
		 // Worker type
		NumberOfWorkers: jsii.Number(2),
	},
})
```

## Properties

- `numberOfWorkers`: number (required) — The number of workers of a defined `WorkerType` that are allocated when a job runs.

- `workerType`: [WorkerType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.WorkerType.html) — Use `workerTypeV2` for more flexibility in defining worker types.

  **Default:** must choose one of `workerType` or `workerTypeV2`

- `workerTypeV2`: [WorkerTypeV2](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.WorkerTypeV2.html) — The type of predefined worker that is allocated when a job runs.

  **Default:** must choose one of `workerType` or `workerTypeV2`

  Can be one of the
  predefined values or dynamic values using `WorkerTypeV2.of(...)`.
