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

*******************
deregister_instance
*******************



.. py:method:: ServiceDiscovery.Client.deregister_instance(**kwargs)

  

  Deletes the Amazon Route 53 DNS records and health check, if any, that Cloud Map created for the specified instance.

  

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


  **Request Syntax**
  ::

    response = client.deregister_instance(
        ServiceId='string',
        InstanceId='string'
    )
    
  :type ServiceId: string
  :param ServiceId: **[REQUIRED]** 

    The ID or Amazon Resource Name (ARN) of the service that the instance is associated with. If the namespace associated with the service is shared with your account, 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 value that you specified for ``Id`` in the `RegisterInstance <https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html>`__ request.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'OperationId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **OperationId** *(string) --* 

        A value that you can use to determine whether the request completed successfully. To get the status of the operation, see `GetOperation <https://docs.aws.amazon.com/cloud-map/latest/api/API_GetOperation.html>`__.

        
  
  **Exceptions**
  
  *   :py:class:`ServiceDiscovery.Client.exceptions.DuplicateRequest`

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

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

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

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

  

  **Examples**

  Example: Deregister a service instance
  ::

    response = client.deregister_instance(
        InstanceId='myservice-53',
        ServiceId='srv-p5zdwlg5uvvzjita',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'OperationId': '4yejorelbukcjzpnr6tlmrghsjwpngf4-k98rnaiq',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  