class_docstr: EMR step for workflow.
class_docstr_tok: ["EMR","step","for","workflow","."]
docstr: Constructs an `EMRStep`.
  
  Args:
      name(str): The name of the EMR step.
      display_name(str): The display name of the EMR step.
      description(str): The description of the EMR step.
      cluster_id(str): The ID of the running EMR cluster.
      step_config(EMRStepConfig): One StepConfig to be executed by the job flow.
      depends_on (List[Union[str, Step, StepCollection]]): A list of `Step`/`StepCollection`
          names or `Step` instances or `StepCollection` instances that this `EMRStep`
          depends on.
      cache_config(CacheConfig):  A `sagemaker.workflow.steps.CacheConfig` instance.
      cluster_config(Dict[str, Any]): The recipe of the
          EMR cluster, passed as a dictionary.
          The elements are defined in the request syntax for `RunJobFlow`.
          However, the following elements are not recognized as part of the cluster
          configuration and you should not include them in the dictionary:
  
          * ``cluster_config[Name]``
          * ``cluster_config[Steps]``
          * ``cluster_config[AutoTerminationPolicy]``
          * ``cluster_config[Instances][KeepJobFlowAliveWhenNoSteps]``
          * ``cluster_config[Instances][TerminationProtected]``
  
          For more information about the fields you can include in your cluster
          configuration, see
          https://docs.aws.amazon.com/emr/latest/APIReference/API_RunJobFlow.html.
          Note that if you want to use ``cluster_config``, then you have to set
          ``cluster_id`` as None.
      execution_role_arn(str): The ARN of the runtime role assumed by this `EMRStep`. The
          job submitted to your EMR cluster uses this role to access AWS resources. This
          value is passed as ExecutionRoleArn to the AddJobFlowSteps request (an EMR request)
          called on the cluster specified by ``cluster_id``, so you can only include this
          field if ``cluster_id`` is not None.
docstr_tok: ["Constructs","an","`","EMRStep","`",".","Args",":","name","(","str",")",":","The","name","of","the","EMR","step",".","display_name","(","str",")",":","The","display","name","of","the","EMR","step",".","description","(","str",")",":","The","description","of","the","EMR","step",".","cluster_id","(","str",")",":","The","ID","of","the","running","EMR","cluster",".","step_config","(","EMRStepConfig",")",":","One","StepConfig","to","be","executed","by","the","job","flow",".","depends_on","(","List","[","Union","[","str",",","Step",",","StepCollection","]","]",")",":","A","list","of","`","Step","`","\/","`","StepCollection","`","names","or","`","Step","`","instances","or","`","StepCollection","`","instances","that","this","`","EMRStep","`","depends","on",".","cache_config","(","CacheConfig",")",":","A","`","sagemaker.workflow.steps.CacheConfig","`","instance",".","cluster_config","(","Dict","[","str",",","Any","]",")",":","The","recipe","of","the","EMR","cluster",",","passed","as","a","dictionary",".","The","elements","are","defined","in","the","request","syntax","for","`","RunJobFlow","`",".","However",",","the","following","elements","are","not","recognized","as","part","of","the","cluster","configuration","and","you","should","not","include","them","in","the","dictionary",":","*","``","cluster_config","[","Name","]","``","*","``","cluster_config","[","Steps","]","``","*","``","cluster_config","[","AutoTerminationPolicy","]","``","*","``","cluster_config","[","Instances","]","[","KeepJobFlowAliveWhenNoSteps","]","``","*","``","cluster_config","[","Instances","]","[","TerminationProtected","]","``","For","more","information","about","the","fields","you","can","include","in","your","cluster","configuration",",","see","https",":","\/\/docs.aws.amazon.com\/emr\/latest\/APIReference\/API_RunJobFlow.html",".","Note","that","if","you","want","to","use","``","cluster_config","``",",","then","you","have","to","set","``","cluster_id","``","as","None",".","execution_role_arn","(","str",")",":","The","ARN","of","the","runtime","role","assumed","by","this","`","EMRStep","`",".","The","job","submitted","to","your","EMR","cluster","uses","this","role","to","access","AWS","resources",".","This","value","is","passed","as","ExecutionRoleArn","to","the","AddJobFlowSteps","request","(","an","EMR","request",")","called","on","the","cluster","specified","by","``","cluster_id","``",",","so","you","can","only","include","this","field","if","``","cluster_id","``","is","not","None","."]
code: def __init__(
      self,
      name: str,
      display_name: str,
      description: str,
      cluster_id: str,
      step_config: EMRStepConfig,
      depends_on: Optional[
          List[Union[str, Step, StepCollection]]
      ] = None,
      cache_config: CacheConfig = None,
      cluster_config: Dict[str, Any] = None,
      execution_role_arn: str = None,
  ):
      """Constructs an `EMRStep`.
  
      Args:
          name(str): The name of the EMR step.
          display_name(str): The display name of the EMR step.
          description(str): The description of the EMR step.
          cluster_id(str): The ID of the running EMR cluster.
          step_config(EMRStepConfig): One StepConfig to be executed by the job flow.
          depends_on (List[Union[str, Step, StepCollection]]): A list of `Step`/`StepCollection`
              names or `Step` instances or `StepCollection` instances that this `EMRStep`
              depends on.
          cache_config(CacheConfig):  A `sagemaker.workflow.steps.CacheConfig` instance.
          cluster_config(Dict[str, Any]): The recipe of the
              EMR cluster, passed as a dictionary.
              The elements are defined in the request syntax for `RunJobFlow`.
              However, the following elements are not recognized as part of the cluster
              configuration and you should not include them in the dictionary:
  
              * ``cluster_config[Name]``
              * ``cluster_config[Steps]``
              * ``cluster_config[AutoTerminationPolicy]``
              * ``cluster_config[Instances][KeepJobFlowAliveWhenNoSteps]``
              * ``cluster_config[Instances][TerminationProtected]``
  
              For more information about the fields you can include in your cluster
              configuration, see
              https://docs.aws.amazon.com/emr/latest/APIReference/API_RunJobFlow.html.
              Note that if you want to use ``cluster_config``, then you have to set
              ``cluster_id`` as None.
          execution_role_arn(str): The ARN of the runtime role assumed by this `EMRStep`. The
              job submitted to your EMR cluster uses this role to access AWS resources. This
              value is passed as ExecutionRoleArn to the AddJobFlowSteps request (an EMR request)
              called on the cluster specified by ``cluster_id``, so you can only include this
              field if ``cluster_id`` is not None.
      """
      super(EMRStep, self).__init__(
          name, display_name, description, StepTypeEnum.EMR, depends_on
      )
  
      emr_step_args = {"StepConfig": step_config.to_request()}
      root_property = Properties(
          step_name=name,
          step=self,
          shape_name="Step",
          service_name="emr",
      )
  
      if cluster_id is None and cluster_config is None:
          raise ValueError(
              ERR_STR_WITHOUT_CLUSTER_ID_AND_CLUSTER_CFG.format(
                  step_name=name
              )
          )
  
      if cluster_id is not None and cluster_config is not None:
          raise ValueError(
              ERR_STR_WITH_BOTH_CLUSTER_ID_AND_CLUSTER_CFG.format(
                  step_name=name
              )
          )
  
      if execution_role_arn is not None and cluster_id is None:
          raise ValueError(
              ERR_STR_WITH_EXEC_ROLE_ARN_AND_WITHOUT_CLUSTER_ID.format(
                  step_name=name
              )
          )
  
      if cluster_id is not None:
          emr_step_args["ClusterId"] = cluster_id
          root_property.__dict__["ClusterId"] = cluster_id
  
          if execution_role_arn is not None:
              emr_step_args["ExecutionRoleArn"] = execution_role_arn
              root_property.__dict__[
                  "ExecutionRoleArn"
              ] = execution_role_arn
      elif cluster_config is not None:
          self._validate_cluster_config(cluster_config, name)
          emr_step_args["ClusterConfig"] = cluster_config
          root_property.__dict__["ClusterConfig"] = cluster_config
  
      self.args = emr_step_args
      self.cache_config = cache_config
      self._properties = root_property
  
file_path: sagemaker-python-sdk/src/sagemaker/workflow/emr_step.py
imports: from __future__ import absolute_import
  from typing import Any, Dict, List, Union, Optional
  from sagemaker.workflow.entities import RequestType
  from sagemaker.workflow.properties import Properties
  from sagemaker.workflow.step_collections import StepCollection
  from sagemaker.workflow.steps import Step, StepTypeEnum, CacheConfig
label_desc: Use image node_id 2 to create a new EMRStep object from inherited base classes: Step with example: obj = EMRStep(name, display_name, description, cluster_id, step_config, depends_on, cache_config, cluster_config, execution_role_arn)