Class EmrCreateCluster

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IChainable, INextable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:10.324Z") @Stability(Stable) public class EmrCreateCluster extends TaskStateBase
A Step Functions Task to create an EMR Cluster.

The ClusterConfiguration is defined as Parameters in the state machine definition.

OUTPUT: the ClusterId.

Example:

 Role clusterRole = Role.Builder.create(this, "ClusterRole")
         .assumedBy(new ServicePrincipal("ec2.amazonaws.com"))
         .build();
 Role serviceRole = Role.Builder.create(this, "ServiceRole")
         .assumedBy(new ServicePrincipal("elasticmapreduce.amazonaws.com"))
         .build();
 Role autoScalingRole = Role.Builder.create(this, "AutoScalingRole")
         .assumedBy(new ServicePrincipal("elasticmapreduce.amazonaws.com"))
         .build();
 autoScalingRole.assumeRolePolicy.addStatements(
 PolicyStatement.Builder.create()
         .effect(Effect.ALLOW)
         .principals(List.of(
             new ServicePrincipal("application-autoscaling.amazonaws.com")))
         .actions(List.of("sts:AssumeRole"))
         .build());
 EmrCreateCluster.Builder.create(this, "Create Cluster")
         .instances(InstancesConfigProperty.builder().build())
         .clusterRole(clusterRole)
         .name(TaskInput.fromJsonPathAt("$.ClusterName").getValue())
         .serviceRole(serviceRole)
         .autoScalingRole(autoScalingRole)
         .build();
 
  • Constructor Details

    • EmrCreateCluster

      protected EmrCreateCluster(software.amazon.jsii.JsiiObjectRef objRef)
    • EmrCreateCluster

      protected EmrCreateCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • EmrCreateCluster

      @Stability(Stable) public EmrCreateCluster(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull EmrCreateClusterProps props)
      Parameters:
      scope - This parameter is required.
      id - Descriptive identifier for this chainable. This parameter is required.
      props - This parameter is required.
  • Method Details

    • getAutoScalingRole

      @Stability(Stable) @NotNull public IRole getAutoScalingRole()
      The autoscaling role for the EMR Cluster.

      Only available after task has been added to a state machine.

    • getClusterRole

      @Stability(Stable) @NotNull public IRole getClusterRole()
      The instance role for the EMR Cluster.

      Only available after task has been added to a state machine.

    • getServiceRole

      @Stability(Stable) @NotNull public IRole getServiceRole()
      The service role for the EMR Cluster.

      Only available after task has been added to a state machine.

    • getTaskMetrics

      @Stability(Stable) @Nullable protected TaskMetricsConfig getTaskMetrics()
      Specified by:
      getTaskMetrics in class TaskStateBase
    • getTaskPolicies

      @Stability(Stable) @Nullable protected List<PolicyStatement> getTaskPolicies()
      Specified by:
      getTaskPolicies in class TaskStateBase