:doc:`ServiceDiscovery <../../servicediscovery>` / Client / update_instance_custom_health_status

************************************
update_instance_custom_health_status
************************************



.. py:method:: ServiceDiscovery.Client.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 <https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/UpdateInstanceCustomHealthStatus>`_  


  **Request Syntax**
  ::

    response = client.update_instance_custom_health_status(
        ServiceId='string',
        InstanceId='string',
        Status='HEALTHY'|'UNHEALTHY'
    )
    
  :type ServiceId: string
  :param ServiceId: **[REQUIRED]** 

    The ID or Amazon Resource Name (ARN) of the service that includes the configuration for the custom health check that you want to change the status for. For services created in a shared namespace, specify the service ARN. For more information about shared namespaces, see `Cross-account Cloud Map namespace sharing <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ in the *Cloud Map Developer Guide*.

    

  
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

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

    

  
  :type Status: string
  :param Status: **[REQUIRED]** 

    The new status of the instance, ``HEALTHY`` or ``UNHEALTHY``.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`ServiceDiscovery.Client.exceptions.InstanceNotFound`

  
  *   :py:class:`ServiceDiscovery.Client.exceptions.ServiceNotFound`

  
  *   :py:class:`ServiceDiscovery.Client.exceptions.CustomHealthNotFound`

  
  *   :py:class:`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': {
            '...': '...',
        },
    }

  