Open rutujachaudhari124 opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @rutujachaudhari124 👋 Thank you for taking the time to raise this! It looks like you're using a fairly old version of both Terraform core and the AWS Provider. Are you able to test on a more recent version to verify if the import is successful?
yes, I have checked in the latest version (4.60.0), still could not resolve this issue. The network interface is still not added to state file.
I'm using the latest version of terraform provider (v5.64.0) and the issue still occurring.
Terraform Core Version
0.12.31
AWS Provider Version
2.70.0
Affected Resource(s)
aws_instance
Expected Behavior
When resource aws_instance is imported, the network interface block must be added to the state file with other parameters which contains the information of the network interface attached, similar to the ebs block devices.
Terraform import should add details in such format in the state file after import:
"network_interface": [ { "delete_on_termination": false, "device_index": 0, "network_interface_id": "*****" } ],
Actual Behavior
When this resource aws_instance is imported, in the tf state file we can see that the network_interface details are not added. It is mentioned as network_interface = [].
The id of primary network_interface is visible as an attribute in the state file, but the network interface block seems empty.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Step 1: create instance Step 2: import instance using command : terraform import aws_instance.instance-01
Step 3: terraform apply
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
https://github.com/hashicorp/terraform-provider-aws/issues/1446
Would you like to implement a fix?
None