attach

EC2.NetworkInterface.attach(**kwargs)

Attaches a network interface to an instance.

See also: AWS API Documentation

Request Syntax

response = network_interface.attach(
    DeviceIndex=123,
    DryRun=True|False,
    InstanceId='string',
    NetworkCardIndex=123,
    EnaSrdSpecification={
        'EnaSrdEnabled': True|False,
        'EnaSrdUdpSpecification': {
            'EnaSrdUdpEnabled': True|False
        }
    }
)
Parameters
  • DeviceIndex (integer) --

    [REQUIRED]

    The index of the device for the network interface attachment.

  • DryRun (boolean) -- 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 .
  • InstanceId (string) --

    [REQUIRED]

    The ID of the instance.

  • NetworkCardIndex (integer) -- The index of the network card. Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 0.
  • EnaSrdSpecification (dict) --

    Configures ENA Express for the network interface that this action attaches to the instance.

    • EnaSrdEnabled (boolean) --

      Indicates whether ENA Express is enabled for the network interface.

    • EnaSrdUdpSpecification (dict) --

      Configures ENA Express for UDP network traffic.

      • EnaSrdUdpEnabled (boolean) --

        Indicates whether UDP traffic uses ENA Express. To specify this setting, you must first enable ENA Express.

Return type

dict

Returns

Response Syntax

{
    'AttachmentId': 'string',
    'NetworkCardIndex': 123
}

Response Structure

  • (dict) --

    Contains the output of AttachNetworkInterface.

    • AttachmentId (string) --

      The ID of the network interface attachment.

    • NetworkCardIndex (integer) --

      The index of the network card.