:doc:`EMR <../../emr>` / Client / set_keep_job_flow_alive_when_no_steps

*************************************
set_keep_job_flow_alive_when_no_steps
*************************************



.. py:method:: EMR.Client.set_keep_job_flow_alive_when_no_steps(**kwargs)

  

  You can use the ``SetKeepJobFlowAliveWhenNoSteps`` to configure a cluster (job flow) to terminate after the step execution, i.e., all your steps are executed. If you want a transient cluster that shuts down after the last of the current executing steps are completed, you can configure ``SetKeepJobFlowAliveWhenNoSteps`` to false. If you want a long running cluster, configure ``SetKeepJobFlowAliveWhenNoSteps`` to true.

   

  For more information, see `Managing Cluster Termination <https://docs.aws.amazon.com/emr/latest/ManagementGuide/UsingEMR_TerminationProtection.html>`__ in the *Amazon EMR Management Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetKeepJobFlowAliveWhenNoSteps>`_  


  **Request Syntax**
  ::

    response = client.set_keep_job_flow_alive_when_no_steps(
        JobFlowIds=[
            'string',
        ],
        KeepJobFlowAliveWhenNoSteps=True|False
    )
    
  :type JobFlowIds: list
  :param JobFlowIds: **[REQUIRED]** 

    A list of strings that uniquely identify the clusters to protect. This identifier is returned by `RunJobFlow <https://docs.aws.amazon.com/emr/latest/APIReference/API_RunJobFlow.html>`__ and can also be obtained from `DescribeJobFlows <https://docs.aws.amazon.com/emr/latest/APIReference/API_DescribeJobFlows.html>`__.

    

  
    - *(string) --* 

    

  :type KeepJobFlowAliveWhenNoSteps: boolean
  :param KeepJobFlowAliveWhenNoSteps: **[REQUIRED]** 

    A Boolean that indicates whether to terminate the cluster after all steps are executed.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`EMR.Client.exceptions.InternalServerError`

  