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.

Container for the parameters to the SetInstanceHealth operation. Sets the health status of the specified instance.

For more information, see Health Checks in the Auto Scaling User Guide.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.AutoScaling.AmazonAutoScalingRequest
      Amazon.AutoScaling.Model.SetInstanceHealthRequest

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

Syntax

C#
public class SetInstanceHealthRequest : AmazonAutoScalingRequest
         IAmazonWebServiceRequest

The SetInstanceHealthRequest type exposes the following members

Constructors

NameDescription
Public Method SetInstanceHealthRequest()

Properties

NameTypeDescription
Public Property HealthStatus System.String

Gets and sets the property HealthStatus.

The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.

Public Property InstanceId System.String

Gets and sets the property InstanceId.

The ID of the instance.

Public Property ShouldRespectGracePeriod System.Boolean

Gets and sets the property ShouldRespectGracePeriod.

If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the description of the health check grace period for CreateAutoScalingGroup.

Examples

This example sets the health status of the specified instance to Unhealthy.

To set the health status of an instance


var response = client.SetInstanceHealth(new SetInstanceHealthRequest 
{
    HealthStatus = "Unhealthy",
    InstanceId = "i-93633f9b"
});


            

Version Information

.NET Standard:
Supported in: 1.3

.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