Interface WorkerConfiguration

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
WorkerConfiguration.Jsii$Proxy

@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)", date="2026-09-17T14:54:05.119Z") @Stability(Stable) public interface WorkerConfiguration extends software.amazon.jsii.JsiiSerializable
The worker configuration for a Spark job.

The worker type and the number of workers are set together: providing this configuration requires both values, so a Spark job can never be given one without the other.

Example:

 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.iam.*;
 Stack stack;
 IRole role;
 Code script;
 PySparkEtlJob.Builder.create(stack, "PySparkETLJob")
         .jobName("PySparkETLJobCustomName")
         .description("This is a description")
         .role(role)
         .script(script)
         .glueVersion(GlueVersion.V5_1)
         .continuousLogging(ContinuousLoggingProps.builder().enabled(false).build())
         .workerConfiguration(WorkerConfiguration.builder()
                 .workerType(WorkerType.G_2X)
                 .numberOfWorkers(2)
                 .build())
         .maxConcurrentRuns(100)
         .timeout(Duration.hours(2))
         .connections(List.of(Connection.fromConnectionName(stack, "Connection", "connectionName")))
         .securityConfiguration(SecurityConfiguration.fromSecurityConfigurationName(stack, "SecurityConfig", "securityConfigName"))
         .tags(Map.of(
                 "FirstTagName", "FirstTagValue",
                 "SecondTagName", "SecondTagValue",
                 "XTagName", "XTagValue"))
         .maxRetries(2)
         .build();
 
  • Method Details

    • getNumberOfWorkers

      @Stability(Stable) @NotNull Number getNumberOfWorkers()
      The number of workers of the given workerType that are allocated when a job runs.
    • getWorkerType

      @Stability(Stable) @NotNull WorkerType getWorkerType()
      The type of predefined worker that is allocated when a job runs.

      See the WorkerType enum for the full set of supported values.

    • builder

      @Stability(Stable) static WorkerConfiguration.Builder builder()
      Returns:
      a WorkerConfiguration.Builder of WorkerConfiguration