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

******************
attach_vpn_gateway
******************



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

  

  Attaches an available virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time.

   

  For more information, see `Amazon Web Services Site-to-Site VPN <https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html>`__ in the *Amazon Web Services Site-to-Site VPN User Guide*.

  

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


  **Request Syntax**
  ::

    response = client.attach_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``.

    

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

    
    ::

      {
          'VpcAttachment': {
              'VpcId': 'string',
              'State': 'attaching'|'attached'|'detaching'|'detached'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Contains the output of AttachVpnGateway.

      
      

      - **VpcAttachment** *(dict) --* 

        Information about the attachment.

        
        

        - **VpcId** *(string) --* 

          The ID of the VPC.

          
        

        - **State** *(string) --* 

          The current state of the attachment.

          
    
  