:doc:`IoTSecureTunneling <../../iotsecuretunneling>` / Client / close_tunnel

************
close_tunnel
************



.. py:method:: IoTSecureTunneling.Client.close_tunnel(**kwargs)

  

  Closes a tunnel identified by the unique tunnel id. When a ``CloseTunnel`` request is received, we close the WebSocket connections between the client and proxy server so no data can be transmitted.

   

  Requires permission to access the `CloseTunnel <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/CloseTunnel>`_  


  **Request Syntax**
  ::

    response = client.close_tunnel(
        tunnelId='string',
        delete=True|False
    )
    
  :type tunnelId: string
  :param tunnelId: **[REQUIRED]** 

    The ID of the tunnel to close.

    

  
  :type delete: boolean
  :param delete: 

    When set to true, IoT Secure Tunneling deletes the tunnel data immediately.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`IoTSecureTunneling.Client.exceptions.ResourceNotFoundException`

  