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 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 SetTerminationProtection on a cluster is similar to calling the Amazon EC2 DisableAPITermination API on all Amazon 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, see Managing Cluster Termination in the Amazon EMR Management Guide.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginSetTerminationProtection and EndSetTerminationProtection.

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

Syntax

C#
public abstract Task<SetTerminationProtectionResponse> SetTerminationProtectionAsync(
         SetTerminationProtectionRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.ElasticMapReduce.Model.SetTerminationProtectionRequest

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

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


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

Exceptions

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

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5

See Also