hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.7k stars 9.07k forks source link

[Enhancement]: Support migrating from auto-managed ENI to self-managed ENI without EC2 replacement #37030

Open KieranP opened 4 months ago

KieranP commented 4 months ago

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

github-actions[bot] commented 4 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue