Resource: aws_network_interface_attachment

Attach an Elastic network interface (ENI) resource with EC2 instance.

Example Usage

resource "aws_network_interface_attachment" "test" {
  instance_id          = aws_instance.test.id
  network_interface_id = aws_network_interface.test.id
  device_index         = 0
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import Elastic network interface (ENI) Attachments using its Attachment ID. For example:

import {
  to = aws_network_interface_attachment.secondary_nic
  id = "eni-attach-0a33842b4ec347c4c"
}

Using terraform import, import Elastic network interface (ENI) Attachments using its Attachment ID. For example:

% terraform import aws_network_interface_attachment.secondary_nic eni-attach-0a33842b4ec347c4c