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

*************************
associate_trunk_interface
*************************



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

  

  Associates a branch network interface with a trunk network interface.

   

  Before you create the association, use `CreateNetworkInterface <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html>`__ command and set the interface type to ``trunk``. You must also create a network interface for each branch network interface that you want to associate with the trunk network interface.

  

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


  **Request Syntax**
  ::

    response = client.associate_trunk_interface(
        BranchInterfaceId='string',
        TrunkInterfaceId='string',
        VlanId=123,
        GreKey=123,
        ClientToken='string',
        DryRun=True|False
    )
    
  :type BranchInterfaceId: string
  :param BranchInterfaceId: **[REQUIRED]** 

    The ID of the branch network interface.

    

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

    The ID of the trunk network interface.

    

  
  :type VlanId: integer
  :param VlanId: 

    The ID of the VLAN. This applies to the VLAN protocol.

    

  
  :type GreKey: integer
  :param GreKey: 

    The application key. This applies to the GRE protocol.

    

  
  :type ClientToken: string
  :param ClientToken: 

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see `Ensuring idempotency <https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html>`__.

    This field is autopopulated if not provided.

  
  :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**

    
    ::

      {
          'InterfaceAssociation': {
              'AssociationId': 'string',
              'BranchInterfaceId': 'string',
              'TrunkInterfaceId': 'string',
              'InterfaceProtocol': 'VLAN'|'GRE',
              'VlanId': 123,
              'GreKey': 123,
              'Tags': [
                  {
                      'Key': 'string',
                      'Value': 'string'
                  },
              ]
          },
          'ClientToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **InterfaceAssociation** *(dict) --* 

        Information about the association between the trunk network interface and branch network interface.

        
        

        - **AssociationId** *(string) --* 

          The ID of the association.

          
        

        - **BranchInterfaceId** *(string) --* 

          The ID of the branch network interface.

          
        

        - **TrunkInterfaceId** *(string) --* 

          The ID of the trunk network interface.

          
        

        - **InterfaceProtocol** *(string) --* 

          The interface protocol. Valid values are ``VLAN`` and ``GRE``.

          
        

        - **VlanId** *(integer) --* 

          The ID of the VLAN when you use the VLAN protocol.

          
        

        - **GreKey** *(integer) --* 

          The application key when you use the GRE protocol.

          
        

        - **Tags** *(list) --* 

          The tags for the trunk interface association.

          
          

          - *(dict) --* 

            Describes a tag.

            
            

            - **Key** *(string) --* 

              The key of the tag.

               

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with ``aws:``.

              
            

            - **Value** *(string) --* 

              The value of the tag.

               

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

              
        
      
    
      

      - **ClientToken** *(string) --* 

        Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see `Ensuring idempotency <https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html>`__.

        
  