'Attaches a network interface to an instance.
:type network_interface_id: str
:param network_interface_id: The ID of the network interface to attach.
:type instance_id: str
:param instance_id: The ID of the instance that will be attached
to the network interface.
:type device_index: int
:param device_index: The index of the device for the network
interface attachment on the instance.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'

def attach_network_interface(self, network_interface_id, instance_id, device_index, dry_run=False):

    params = {'NetworkInterfaceId': network_interface_id, 'InstanceId': instance_id, 'DeviceIndex': device_index}
    if dry_run:
        params['DryRun'] = 'true'
    return self.get_status('AttachNetworkInterface', params, verb='POST')
