Skip to content

Resource: awsNetworkInterfaceAttachment

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

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.networkInterfaceAttachment.NetworkInterfaceAttachmentA(this, "test", {
  deviceIndex: 0,
  instanceId: "${aws_instance.test.id}",
  networkInterfaceId: "${aws_network_interface.test.id}",
});

Argument Reference

The following arguments are supported:

  • instanceId - (Required) Instance ID to attach.
  • networkInterfaceId - (Required) ENI ID to attach.
  • deviceIndex - (Required) Network interface index (int).

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • instanceId - Instance ID.
  • networkInterfaceId - Network interface ID.
  • attachmentId - The ENI Attachment ID.
  • status - The status of the Network Interface Attachment.

Import

Elastic network interface (ENI) Attachments can be imported using its Attachment ID e.g.,

terraform import aws_network_interface_attachment.secondary_nic eni-attach-0a33842b4ec347c4c