:doc:`Vpc <index>` / Action / attach_internet_gateway

***********************
attach_internet_gateway
***********************



.. py:method:: EC2.Vpc.attach_internet_gateway(**kwargs)

  

  Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC. For more information, see `Internet gateways <https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html>`__ in the *Amazon VPC User Guide*.

  

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


  **Request Syntax**
  ::

    response = vpc.attach_internet_gateway(
        DryRun=True|False,
        InternetGatewayId='string',
        
    )
    
  :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``.

    

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

    The ID of the internet gateway.

    

  
  
  :returns: None