Terraform-provider-aws: providers/aws aws_instance not importing network interfaces

Created on 17 Aug 2017  ·  3Comments  ·  Source: hashicorp/terraform-provider-aws

Terraform Version

Terraform v0.10.2

Affected Resource(s)

  • aws_instance

Expected Behavior

tfstate should bring all the network interfaces attached to the instance like ebs block devices.

Actual Behavior

It always import 0 interfaces

Steps to Reproduce

  1. import AWS instance with 2 or more network interfaces attached to it terraform import aws_instance.test instance-id
  2. check terraform.tfstate, you will see network_interface.#: "0"
  3. if you try to add them manually to configuration file and execute terraform plan you will get -/+ aws_instance.test (new resource required) ... Plan: 1 to add, 0 to change, 1 to destroy.
bug servicec2

Most helpful comment

figured it out, moved attachment declaration from inside of instance to inside of network_interface and all was good.

All 3 comments

I believe this is still an issue. Is there any work around or fix?

figured it out, moved attachment declaration from inside of instance to inside of network_interface and all was good.

Given the original issue reporter is no longer on GitHub and the above comments are self-resolved, I'm going to close this.

Was this page helpful?
0 / 5 - 0 ratings