Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

AttachNetworkInterface

Description

Attaches a network interface to an instance.

Request Parameters

NetworkInterfaceId

The ID of the network interface to attach.

Type: String

Default: None

Required: Yes

InstanceId

The ID of the instance to attach to the network interface.

Type: String

Default: None

Required: Yes

DeviceIndex

The index of the device for the network interface attachment.

Type: Integer

Default: None

Required: Yes

Response Elements

The following elements are returned in an AttachNetworkInterfaceResponse element.

requestId

The ID of the attachment request.

Type: xsd:string

attachmentId

The ID of the attachment.

Type: xsd:string

Examples

Example Request

This example attaches an elastic network interface (ENI) eni-ffda3197 to the specified instance i-9cc316fe.

https://ec2.amazonaws.com/?Action=AttachNetworkInterface
&DeviceIndex=1
&InstanceId=i-9cc316fe
&NetworkInterfaceId=eni-ffda3197
&AUTHPARAMS

Example Response

<AttachNetworkInterfaceResponse xmlns='http://ec2.amazonaws.com/doc/2013-02-01/'>
    <requestId>ace8cd1e-e685-4e44-90fb-92014d907212</requestId>
    <attachmentId>eni-attach-d94b09b0</attachmentId>
</AttachNetworkInterfaceResponse>