AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

SetTerminationProtection locks a cluster (job flow) so the 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 SetTerminationProtection on a cluster is similar to calling the Amazon EC2 DisableAPITermination API on all EC2 instances in a cluster.

SetTerminationProtection is 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 SetTerminationProtection to true, you must first unlock the job flow by a subsequent call to SetTerminationProtection in which you set the value to false.

For more information, seeManaging Cluster Termination in the Amazon EMR Management Guide.


For .NET Core and PCL this operation is only available in asynchronous form. Please refer to SetTerminationProtectionAsync.

Namespace: Amazon.ElasticMapReduce
Assembly: AWSSDK.ElasticMapReduce.dll
Version: 3.x.y.z


public virtual SetTerminationProtectionResponse SetTerminationProtection(
         SetTerminationProtectionRequest request
Type: Amazon.ElasticMapReduce.Model.SetTerminationProtectionRequest

Container for the necessary parameters to execute the SetTerminationProtection service method.

Return Value
The response from the SetTerminationProtection service method, as returned by ElasticMapReduce.


InternalServerErrorException Indicates that an error occurred while processing the request and that the request was not completed.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

See Also