/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ServiceDiscovery { namespace Model { /** *

A complex type that contains information about an optional custom health * check. A custom health check, which requires that you use a third-party health * checker to evaluate the health of your resources, is useful in the following * circumstances:

*

If you specify a health check configuration, you can specify either * HealthCheckCustomConfig or HealthCheckConfig but not * both.

To change the status of a custom health check, submit * an UpdateInstanceCustomHealthStatus request. AWS Cloud Map doesn't * monitor the status of the resource, it just keeps a record of the status * specified in the most recent UpdateInstanceCustomHealthStatus * request.

Here's how custom health checks work:

  1. You * create a service and specify a value for FailureThreshold.

    *

    The failure threshold indicates the number of 30-second intervals you want * AWS Cloud Map to wait between the time that your application sends an UpdateInstanceCustomHealthStatus * request and the time that AWS Cloud Map stops routing internet traffic to the * corresponding resource.

  2. You register an instance.

  3. *
  4. You configure a third-party health checker to monitor the resource that * is associated with the new instance.

    AWS Cloud Map doesn't check * the health of the resource directly.

  5. The third-party * health-checker determines that the resource is unhealthy and notifies your * application.

  6. Your application submits an * UpdateInstanceCustomHealthStatus request.

  7. AWS * Cloud Map waits for (FailureThreshold x 30) seconds.

  8. *

    If another UpdateInstanceCustomHealthStatus request doesn't * arrive during that time to change the status back to healthy, AWS Cloud Map * stops routing traffic to the resource.

See Also:

AWS * API Reference

*/ class AWS_SERVICEDISCOVERY_API HealthCheckCustomConfig { public: HealthCheckCustomConfig(); HealthCheckCustomConfig(Aws::Utils::Json::JsonView jsonValue); HealthCheckCustomConfig& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** *

The number of 30-second intervals that you want AWS Cloud Map to wait after * receiving an UpdateInstanceCustomHealthStatus request before it * changes the health status of a service instance. For example, suppose you * specify a value of 2 for FailureTheshold, and then * your application sends an UpdateInstanceCustomHealthStatus request. * AWS Cloud Map waits for approximately 60 seconds (2 x 30) before changing the * status of the service instance based on that request.

Sending a second or * subsequent UpdateInstanceCustomHealthStatus request with the same * value before FailureThreshold x 30 seconds has passed doesn't * accelerate the change. AWS Cloud Map still waits FailureThreshold x * 30 seconds after the first request to make the change.

*/ inline int GetFailureThreshold() const{ return m_failureThreshold; } /** *

The number of 30-second intervals that you want AWS Cloud Map to wait after * receiving an UpdateInstanceCustomHealthStatus request before it * changes the health status of a service instance. For example, suppose you * specify a value of 2 for FailureTheshold, and then * your application sends an UpdateInstanceCustomHealthStatus request. * AWS Cloud Map waits for approximately 60 seconds (2 x 30) before changing the * status of the service instance based on that request.

Sending a second or * subsequent UpdateInstanceCustomHealthStatus request with the same * value before FailureThreshold x 30 seconds has passed doesn't * accelerate the change. AWS Cloud Map still waits FailureThreshold x * 30 seconds after the first request to make the change.

*/ inline bool FailureThresholdHasBeenSet() const { return m_failureThresholdHasBeenSet; } /** *

The number of 30-second intervals that you want AWS Cloud Map to wait after * receiving an UpdateInstanceCustomHealthStatus request before it * changes the health status of a service instance. For example, suppose you * specify a value of 2 for FailureTheshold, and then * your application sends an UpdateInstanceCustomHealthStatus request. * AWS Cloud Map waits for approximately 60 seconds (2 x 30) before changing the * status of the service instance based on that request.

Sending a second or * subsequent UpdateInstanceCustomHealthStatus request with the same * value before FailureThreshold x 30 seconds has passed doesn't * accelerate the change. AWS Cloud Map still waits FailureThreshold x * 30 seconds after the first request to make the change.

*/ inline void SetFailureThreshold(int value) { m_failureThresholdHasBeenSet = true; m_failureThreshold = value; } /** *

The number of 30-second intervals that you want AWS Cloud Map to wait after * receiving an UpdateInstanceCustomHealthStatus request before it * changes the health status of a service instance. For example, suppose you * specify a value of 2 for FailureTheshold, and then * your application sends an UpdateInstanceCustomHealthStatus request. * AWS Cloud Map waits for approximately 60 seconds (2 x 30) before changing the * status of the service instance based on that request.

Sending a second or * subsequent UpdateInstanceCustomHealthStatus request with the same * value before FailureThreshold x 30 seconds has passed doesn't * accelerate the change. AWS Cloud Map still waits FailureThreshold x * 30 seconds after the first request to make the change.

*/ inline HealthCheckCustomConfig& WithFailureThreshold(int value) { SetFailureThreshold(value); return *this;} private: int m_failureThreshold; bool m_failureThresholdHasBeenSet; }; } // namespace Model } // namespace ServiceDiscovery } // namespace Aws