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-08-19T15:41:43.468Z") @Stability(Experimental) public interface WorkerConfiguration extends software.amazon.jsii.JsiiSerializable
(experimental) 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(Experimental) @NotNull Number getNumberOfWorkers()
      (experimental) The number of workers of the given workerType that are allocated when a job runs.
    • getWorkerType

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

      Enum options: Standard, G_1X, G_2X, G_025X, G_4X, G_8X, Z_2X

    • builder

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