Tagging Network Interfaces


I’ve noticed that network interfaces created when creating load balancer, EFS, and auto scaling groups don’t tag the network interfaces.

Is there anyway to tag these when creating the resources?

Thanks for your time.

Hi @pjbeard99,

I’m guessing that by “EFS” you mean “Elastic Filesystem” and therefore you are asking broadly about AWS API features.

In some situations like those you’ve described in your question Terraform is directly managing one object which in turn causes the remote service to create and manage other objects. Those objects are not directly managed by Terraform and so it’s not generally possible to have Terraform manage tagging for them, aside from some fragile hacks.

Solving this therefore requires that the service in question offer some way to tell it how to tag the objects it creates and for that to be exposed via the Terraform provider. In that case Terraform itself does not tag the objects but instead asks the remote system to tag the objects it creates. Whether that’s possible and how to achieve it unfortunately varies between AWS services, and if you are trying to use a service whose API doesn’t offer that feature then Terraform cannot implement something the underlying platform doesn’t support and so you’d probably need to send a feature request to AWS for adding a new API feature to allow setting the tags.

In the case of network interfaces unfortunately there are many situations in AWS where a service creates one automatically behind the scenes and there isn’t typically any way to configure how it gets created. Therefore most network interfaces in a VPC are typically not tagged, unless you’ve explicitly created the network interface and then associated it with another object yourself.

1 Like

Hi @apparentlymart

Many hanks for the explanation. Makes total sense.