:doc:`EC2 <../../ec2>` / Client / detach_vpn_gateway

******************
detach_vpn_gateway
******************



.. py:method:: EC2.Client.detach_vpn_gateway(**kwargs)

  

  Detaches a virtual private gateway from a VPC. You do this if you're planning to turn off the VPC and not use it anymore. You can confirm a virtual private gateway has been completely detached from a VPC by describing the virtual private gateway (any attachments to the virtual private gateway are also described).

   

  You must wait for the attachment's state to switch to ``detached`` before you can delete the VPC or attach a different VPC to the virtual private gateway.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway>`_  


  **Request Syntax**
  ::

    response = client.detach_vpn_gateway(
        VpcId='string',
        VpnGatewayId='string',
        DryRun=True|False
    )
    
  :type VpcId: string
  :param VpcId: **[REQUIRED]** 

    The ID of the VPC.

    

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

    The ID of the virtual private gateway.

    

  
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

  
  
  :returns: None