update_instance_custom_health_status

update_instance_custom_health_status(**kwargs)

Submits a request to change the health status of a custom health check to healthy or unhealthy.

You can use UpdateInstanceCustomHealthStatus to change the status only for custom health checks, which you define using HealthCheckCustomConfig when you create a service. You can't use it to change the status for Route 53 health checks, which you define using HealthCheckConfig .

For more information, see HealthCheckCustomConfig.

See also: AWS API Documentation

Request Syntax

response = client.update_instance_custom_health_status(
    ServiceId='string',
    InstanceId='string',
    Status='HEALTHY'|'UNHEALTHY'
)
Parameters
  • ServiceId (string) --

    [REQUIRED]

    The ID of the service that includes the configuration for the custom health check that you want to change the status for.

  • InstanceId (string) --

    [REQUIRED]

    The ID of the instance that you want to change the health status for.

  • Status (string) --

    [REQUIRED]

    The new status of the instance, HEALTHY or UNHEALTHY .

Returns

None

Exceptions

  • ServiceDiscovery.Client.exceptions.InstanceNotFound
  • ServiceDiscovery.Client.exceptions.ServiceNotFound
  • ServiceDiscovery.Client.exceptions.CustomHealthNotFound
  • ServiceDiscovery.Client.exceptions.InvalidInput

Examples

This example submits a request to change the health status of an instance associated with a service with a custom health check to HEALTHY.

response = client.update_instance_custom_health_status(
    InstanceId='i-abcd1234',
    ServiceId='srv-e4anhexample0004',
    Status='HEALTHY',
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}