EMR / Client / set_termination_protection
SetTerminationProtection locks a cluster (job flow) so the Amazon EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. The cluster still terminates upon successful completion of the job flow. Calling
SetTerminationProtectionon a cluster is similar to calling the Amazon EC2
DisableAPITerminationAPI on all Amazon EC2 instances in a cluster.
SetTerminationProtectionis used to prevent accidental termination of a cluster and to ensure that in the event of an error, the instances persist so that you can recover any data stored in their ephemeral instance storage.
To terminate a cluster that has been locked by setting
true, you must first unlock the job flow by a subsequent call to
SetTerminationProtectionin which you set the value to
For more information, see Managing Cluster Termination in the Amazon EMR Management Guide.
See also: AWS API Documentation
response = client.set_termination_protection( JobFlowIds=[ 'string', ], TerminationProtected=True|False )
JobFlowIds (list) –
A list of strings that uniquely identify the clusters to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .
TerminationProtected (boolean) –
A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.