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

***********************************
create_network_interface_permission
***********************************



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

  

  Grants an Amazon Web Services-authorized account permission to attach the specified network interface to an instance in their account.

   

  You can grant permission to a single Amazon Web Services account only, and only one account at a time.

  

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


  **Request Syntax**
  ::

    response = client.create_network_interface_permission(
        NetworkInterfaceId='string',
        AwsAccountId='string',
        AwsService='string',
        Permission='INSTANCE-ATTACH'|'EIP-ASSOCIATE',
        DryRun=True|False
    )
    
  :type NetworkInterfaceId: string
  :param NetworkInterfaceId: **[REQUIRED]** 

    The ID of the network interface.

    

  
  :type AwsAccountId: string
  :param AwsAccountId: 

    The Amazon Web Services account ID.

    

  
  :type AwsService: string
  :param AwsService: 

    The Amazon Web Services service. Currently not supported.

    

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

    The type of permission to grant.

    

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

    
    ::

      {
          'InterfacePermission': {
              'NetworkInterfacePermissionId': 'string',
              'NetworkInterfaceId': 'string',
              'AwsAccountId': 'string',
              'AwsService': 'string',
              'Permission': 'INSTANCE-ATTACH'|'EIP-ASSOCIATE',
              'PermissionState': {
                  'State': 'pending'|'granted'|'revoking'|'revoked',
                  'StatusMessage': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Contains the output of CreateNetworkInterfacePermission.

      
      

      - **InterfacePermission** *(dict) --* 

        Information about the permission for the network interface.

        
        

        - **NetworkInterfacePermissionId** *(string) --* 

          The ID of the network interface permission.

          
        

        - **NetworkInterfaceId** *(string) --* 

          The ID of the network interface.

          
        

        - **AwsAccountId** *(string) --* 

          The Amazon Web Services account ID.

          
        

        - **AwsService** *(string) --* 

          The Amazon Web Services service.

          
        

        - **Permission** *(string) --* 

          The type of permission.

          
        

        - **PermissionState** *(dict) --* 

          Information about the state of the permission.

          
          

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

            The state of the permission.

            
          

          - **StatusMessage** *(string) --* 

            A status message, if applicable.

            
      
    
  