{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2608","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2608/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2608/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2608/events","html_url":"https://github.com/hashicorp/terraform/issues/2608","id":92568785,"number":2608,"title":"aws_network_interface forces aws_instance eth0 subnet change. ","user":{"login":"suizman","id":12419155,"avatar_url":"https://avatars.githubusercontent.com/u/12419155?v=3","gravatar_id":"","url":"https://api.github.com/users/suizman","html_url":"https://github.com/suizman","followers_url":"https://api.github.com/users/suizman/followers","following_url":"https://api.github.com/users/suizman/following{/other_user}","gists_url":"https://api.github.com/users/suizman/gists{/gist_id}","starred_url":"https://api.github.com/users/suizman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suizman/subscriptions","organizations_url":"https://api.github.com/users/suizman/orgs","repos_url":"https://api.github.com/users/suizman/repos","events_url":"https://api.github.com/users/suizman/events{/privacy}","received_events_url":"https://api.github.com/users/suizman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-02T07:21:29Z","updated_at":"2016-03-29T19:51:19Z","closed_at":"2016-03-29T19:51:19Z","body":"Hi yesterday i've downloaded the latest 0.6.0 release to give a try on a new aws_network_interface functionality. The case is that it isnt working very well. Once i create some instances and attach to them a second aws interface when i execute \"terraform plan\" it foreces to destroy the instance becouse form some reason when the terraform.tfstate refreshes the the subnet_id of the default eth0 changes with subnet_id for the new eni eth1:\r\n\r\nterraform.tfstate >>>\r\n\r\n                \"aws_instance.proxy.0\": {\r\n                    \"type\": \"aws_instance\",\r\n                    \"depends_on\": [\r\n                        \"aws_security_group.gbx\",\r\n                        \"aws_security_group.proxy\",\r\n                        \"aws_subnet.management\"\r\n                    ],\r\n                    \"primary\": {\r\n                        \"id\": \"i-8d506327\",\r\n                        \"attributes\": {\r\n                            \"ami\": \"ami-e6602191\",\r\n                            \"associate_public_ip_address\": \"true\",\r\n                            \"availability_zone\": \"eu-west-1a\",\r\n                            \"ebs_block_device.#\": \"1\",\r\n                            \"ebs_block_device.3905984573.delete_on_termination\": \"true\",\r\n                            \"ebs_block_device.3905984573.device_name\": \"/dev/xvdb\",\r\n                            \"ebs_block_device.3905984573.encrypted\": \"false\",\r\n                            \"ebs_block_device.3905984573.iops\": \"0\",\r\n                            \"ebs_block_device.3905984573.snapshot_id\": \"\",\r\n                            \"ebs_block_device.3905984573.volume_size\": \"10\",\r\n                            \"ebs_block_device.3905984573.volume_type\": \"standard\",\r\n                            \"ebs_optimized\": \"false\",\r\n                            \"ephemeral_block_device.#\": \"0\",\r\n                            \"id\": \"i-8d506327\",\r\n                            \"instance_type\": \"t2.micro\",\r\n                            \"monitoring\": \"false\",\r\n                            \"private_dns\": \"ip-172-18-0-167.eu-west-1.compute.internal\",\r\n                            \"private_ip\": \"172.18.0.167\",\r\n                            \"public_dns\": \"\",\r\n                            \"public_ip\": \"52.16.180.145\",\r\n                            \"root_block_device.#\": \"1\",\r\n                            \"root_block_device.0.delete_on_termination\": \"true\",\r\n                            \"root_block_device.0.iops\": \"0\",\r\n                            \"root_block_device.0.volume_size\": \"16\",\r\n                            \"root_block_device.0.volume_type\": \"standard\",\r\n                            \"security_groups.#\": \"0\",\r\n                            \"source_dest_check\": \"false\",\r\n                            \"subnet_id\": \"subnet-601a8017\",\r\n                            \"tags.#\": \"3\",\r\n                            \"tags.Greenbox\": \"gbx1\",\r\n                            \"tags.Hostname\": \"proxy0\",\r\n                            \"tags.Name\": \"gbx1-proxy0\",\r\n                            \"tenancy\": \"default\",\r\n                            \"vpc_security_group_ids.#\": \"2\",\r\n                            \"vpc_security_group_ids.1071140996\": \"sg-4a1c1d2f\",\r\n                            \"vpc_security_group_ids.2537102243\": \"sg-4b1c1d2e\"\r\n                        },\r\n                        \"meta\": {\r\n                            \"schema_version\": \"1\"\r\n                        }\r\n                    }\r\n                },\r\nterraform plan output >>>\r\n\r\n-/+ aws_instance.proxy\r\n    ami:                                               \"ami-e6602191\" => \"ami-e6602191\"\r\n    associate_public_ip_address:                       \"true\" => \"1\"\r\n    availability_zone:                                 \"eu-west-1a\" => \"eu-west-1a\"\r\n    ebs_block_device.#:                                \"1\" => \"1\"\r\n    ebs_block_device.3905984573.delete_on_termination: \"true\" => \"1\"\r\n    ebs_block_device.3905984573.device_name:           \"/dev/xvdb\" => \"/dev/xvdb\"\r\n    ebs_block_device.3905984573.encrypted:             \"false\" => \"<computed>\"\r\n    ebs_block_device.3905984573.iops:                  \"0\" => \"<computed>\"\r\n    ebs_block_device.3905984573.snapshot_id:           \"\" => \"<computed>\"\r\n    ebs_block_device.3905984573.volume_size:           \"10\" => \"10\"\r\n    ebs_block_device.3905984573.volume_type:           \"standard\" => \"standard\"\r\n    ephemeral_block_device.#:                          \"0\" => \"<computed>\"\r\n    instance_type:                                     \"t2.micro\" => \"t2.micro\"\r\n    key_name:                                          \"\" => \"<computed>\"\r\n    placement_group:                                   \"\" => \"<computed>\"\r\n    private_dns:                                       \"ip-172-18-0-168.eu-west-1.compute.internal\" => \"<computed>\"\r\n    private_ip:                                        \"172.18.0.168\" => \"<computed>\"\r\n    public_dns:                                        \"\" => \"<computed>\"\r\n    public_ip:                                         \"52.16.182.109\" => \"<computed>\"\r\n    root_block_device.#:                               \"1\" => \"<computed>\"\r\n    security_groups.#:                                 \"0\" => \"<computed>\"\r\n    source_dest_check:                                 \"false\" => \"0\"\r\n    subnet_id:                                         \"subnet-601a8017\" => \"subnet-621a8015\" (forces new resource)\r\n    tags.#:                                            \"3\" => \"3\"\r\n    tags.Greenbox:                                     \"gbx1\" => \"gbx1\"\r\n    tags.Hostname:                                     \"proxy0\" => \"proxy0\"\r\n    tags.Name:                                         \"gbx1-proxy0\" => \"gbx1-proxy0\"\r\n    tenancy:                                           \"default\" => \"<computed>\"\r\n    vpc_security_group_ids.#:                          \"2\" => \"2\"\r\n    vpc_security_group_ids.1071140996:                 \"sg-4a1c1d2f\" => \"sg-4a1c1d2f\"\r\n    vpc_security_group_ids.2537102243:                 \"sg-4b1c1d2e\" => \"sg-4b1c1d2e\"\r\n\r\n+ aws_network_interface.proxy0-management\r\n    attachment.#:                         \"\" => \"1\"\r\n    attachment.~3470761036.attachment_id: \"\" => \"<computed>\"\r\n    attachment.~3470761036.device_index:  \"\" => \"1\"\r\n    attachment.~3470761036.instance:      \"\" => \"${aws_instance.proxy.0.id}\"\r\n    security_groups.#:                    \"\" => \"1\"\r\n    security_groups.2537102243:           \"\" => \"sg-4b1c1d2e\"\r\n    subnet_id:                            \"\" => \"subnet-601a8017\"\r\n    tags.#:                               \"\" => \"2\"\r\n    tags.Greenbox:                        \"\" => \"gbx1\"\r\n    tags.Name:                            \"\" => \"gbx1-proxy0-management\"\r\n\r\nAdditionaly aws_network_interface forces private_ips from 1 >>> 0\r\n\r\nterraform.tfstate >>>\r\n                \"aws_network_interface.proxy0-service\": {\r\n                    \"type\": \"aws_network_interface\",\r\n                    \"depends_on\": [\r\n                        \"aws_instance.proxy\",\r\n                        \"aws_security_group.proxy\",\r\n                        \"aws_subnet.service\"\r\n                    ],\r\n                    \"primary\": {\r\n                        \"id\": \"eni-ff1ffab6\",\r\n                        \"attributes\": {\r\n                            \"attachment.#\": \"1\",\r\n                            \"attachment.3876967536.attachment_id\": \"eni-attach-10fe7552\",\r\n                            \"attachment.3876967536.device_index\": \"1\",\r\n                            \"attachment.3876967536.instance\": \"i-8d506327\",\r\n                            \"id\": \"eni-ff1ffab6\",\r\n                            \"private_ips.#\": \"1\",\r\n                            \"private_ips.2201243490\": \"172.18.1.181\",\r\n                            \"security_groups.#\": \"1\",\r\n                            \"security_groups.2537102243\": \"sg-4b1c1d2e\",\r\n                            \"subnet_id\": \"subnet-621a8015\",\r\n                            \"tags.#\": \"2\",\r\n                            \"tags.Greenbox\": \"gbx1\",\r\n                            \"tags.Name\": \"gbx1-proxy0-servicez\"\r\n                        }\r\n                    }\r\n                },\r\nPlan output >>>\r\n\r\n/+ aws_network_interface.proxy0-service\r\n    attachment.#:                       \"1\" => \"1\"\r\n    attachment.3876967536.device_index: \"1\" => \"0\"\r\n    attachment.3876967536.instance:     \"i-8d506327\" => \"\"\r\n    attachment.~41262290.attachment_id: \"\" => \"<computed>\"\r\n    attachment.~41262290.device_index:  \"\" => \"1\"\r\n    attachment.~41262290.instance:      \"\" => \"${aws_instance.proxy.1.id}\"\r\n    private_ips.#:                      \"1\" => \"0\" (forces new resource)\r\n    private_ips.2201243490:             \"172.18.1.181\" => \"\"\r\n    security_groups.#:                  \"1\" => \"1\"\r\n    security_groups.2537102243:         \"sg-4b1c1d2e\" => \"sg-4b1c1d2e\"\r\n    subnet_id:                          \"subnet-621a8015\" => \"subnet-621a8015\"\r\n    tags.#:                             \"2\" => \"2\"\r\n    tags.Greenbox:                      \"gbx1\" => \"gbx1\"\r\n    tags.Name:                          \"gbx1-proxy0-servicez\" => \"gbx1-proxy0-servicez\"\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/203070558","html_url":"https://github.com/hashicorp/terraform/issues/2608#issuecomment-203070558","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2608","id":203070558,"user":{"login":"catsby","id":61721,"avatar_url":"https://avatars.githubusercontent.com/u/61721?v=3","gravatar_id":"","url":"https://api.github.com/users/catsby","html_url":"https://github.com/catsby","followers_url":"https://api.github.com/users/catsby/followers","following_url":"https://api.github.com/users/catsby/following{/other_user}","gists_url":"https://api.github.com/users/catsby/gists{/gist_id}","starred_url":"https://api.github.com/users/catsby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catsby/subscriptions","organizations_url":"https://api.github.com/users/catsby/orgs","repos_url":"https://api.github.com/users/catsby/repos","events_url":"https://api.github.com/users/catsby/events{/privacy}","received_events_url":"https://api.github.com/users/catsby/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T19:51:19Z","updated_at":"2016-03-29T19:51:19Z","body":"Hey @suizman – so sorry for my delay here! Thank you for following up, I'll close this (finally!)"}}