When we set up our infra, we let aws_instance resource create the network interface for us. But now we need to manage these ourselves, so we created an aws_network_interface resource and imported it into the state (which worked fine), but now when we add the network_interface block into the aws_instance resource, it will force a replacement of the EC2 instance, even through the ENI ID is the same as what is currently being used. It would be nice if Terraform recognized that the original ENI is the same as as the new ENI (i.e. has been imported, not replaced/modified) and did not try to replace the EC2 instance.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
When we set up our infra, we let aws_instance resource create the network interface for us. But now we need to manage these ourselves, so we created an aws_network_interface resource and imported it into the state (which worked fine), but now when we add the network_interface block into the aws_instance resource, it will force a replacement of the EC2 instance, even through the ENI ID is the same as what is currently being used. It would be nice if Terraform recognized that the original ENI is the same as as the new ENI (i.e. has been imported, not replaced/modified) and did not try to replace the EC2 instance.
Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
No response
References
No response
Would you like to implement a fix?
None