rey don sancho
rey don sancho

Reputation: 493

What is an elastic network interface (ENI) and when would you use it?

An elastic network interface is defined as a virtual network interface https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html.

I was wondering what use cases exist of this. Why would not I simply put directly an instance instead of having to use the eni, and attach it to an instance.

Thks!

Upvotes: 10

Views: 3599

Answers (1)

Adi Dembak
Adi Dembak

Reputation: 2536

Decoupling the ENI from the EC2 instance allows you far more flexibility.

You can connect several ENIs to the same EC2 instance and be attached to different subnets, for example:

  • ENI A connected to a public-facing subnet

  • ENI B connected to an internal private subnet

You could, for example, attach an ENI to a running EC2 instance, or you could have it live after the EC2 instance is deleted.

As a form of "cheap" high availability: Attach a ENI to an EC2 instance; if the instance dies launch another one and attach the ENI to it. Traffic flow will only be interrupted for a short period.

There are many scenarios where this flexibility comes in handy.

Upvotes: 6

Related Questions