{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3205","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3205/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3205/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3205/events","html_url":"https://github.com/hashicorp/terraform/issues/3205","id":105771135,"number":3205,"title":"AWS: attach new security group to eth0 in an existing instance with 2 interfaces.","user":{"login":"jllucas","id":5269017,"avatar_url":"https://avatars3.githubusercontent.com/u/5269017?v=3","gravatar_id":"","url":"https://api.github.com/users/jllucas","html_url":"https://github.com/jllucas","followers_url":"https://api.github.com/users/jllucas/followers","following_url":"https://api.github.com/users/jllucas/following{/other_user}","gists_url":"https://api.github.com/users/jllucas/gists{/gist_id}","starred_url":"https://api.github.com/users/jllucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jllucas/subscriptions","organizations_url":"https://api.github.com/users/jllucas/orgs","repos_url":"https://api.github.com/users/jllucas/repos","events_url":"https://api.github.com/users/jllucas/events{/privacy}","received_events_url":"https://api.github.com/users/jllucas/received_events","type":"User","site_admin":false},"labels":[{"id":85946957,"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":127939518,"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-09-10T09:43:06Z","updated_at":"2017-03-22T19:37:49Z","closed_at":null,"body":"Hi all,\n\nIn my AWS infrastructure I've created a new security group (newsecgroup). \nWhen attaching it to an already running instance with 2 interfaces, terraform raises the following error:\n\n```\n* aws_instance.myinstance: InvalidInstanceID: There are multiple interfaces attached to instance 'i-XXXXX'. Please specify an interface ID for the operation instead.\n    status code: 400, request id: []\n```\n\nI only want to attach it to eth0, and not to eth1.\n\nHere is my terraform definition:\n\n``` hcl\nresource \"aws_instance\" \"myinstance\" {\n  ...\n  vpc_security_group_ids = [ \"${aws_security_group.default.id}\", \"${aws_security_group.newsecgroup.id}\" ]\n ...\n\nresource \"aws_network_interface\" \"myinstance-service\" {\n    ...\n    security_groups = [ \"${aws_security_group.default.id}\" ]\n   ...\n}\n```\n\nIf I don't define a resource for eth0 (default network interface), how can I specify the interface ID?\nAny clue?\n\nThanks!\n\nEDIT --> If I attach the security group using AWS console, and execute `terraform plan`, terraform shows \"No changes\".\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/288514817","html_url":"https://github.com/hashicorp/terraform/issues/3205#issuecomment-288514817","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3205","id":288514817,"user":{"login":"grubernaut","id":3082319,"avatar_url":"https://avatars1.githubusercontent.com/u/3082319?v=3","gravatar_id":"","url":"https://api.github.com/users/grubernaut","html_url":"https://github.com/grubernaut","followers_url":"https://api.github.com/users/grubernaut/followers","following_url":"https://api.github.com/users/grubernaut/following{/other_user}","gists_url":"https://api.github.com/users/grubernaut/gists{/gist_id}","starred_url":"https://api.github.com/users/grubernaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grubernaut/subscriptions","organizations_url":"https://api.github.com/users/grubernaut/orgs","repos_url":"https://api.github.com/users/grubernaut/repos","events_url":"https://api.github.com/users/grubernaut/events{/privacy}","received_events_url":"https://api.github.com/users/grubernaut/received_events","type":"User","site_admin":false},"created_at":"2017-03-22T19:37:49Z","updated_at":"2017-03-22T19:37:49Z","body":"Hi all, \r\n\r\nI came across this issue when solving #12933. The error: \r\n```\r\n aws_instance.myinstance: InvalidInstanceID: There are multiple interfaces attached to instance 'i-XXXXX'. Please specify an interface ID for the operation instead.\r\n    status code: 400, request id: []\r\n```\r\nActually comes from Terraform attempting to set the `source_dest_check` attribute on the instance when there are multiple network interfaces on the instance, and the interface at `device_index` 0 isn't the default interface. \r\nUnfortunately it's a fairly cryptic error message :cry: \r\n\r\nThat being said, after #12933 lands, users should be able to create their network interfaces directly in the instance resource, thus eliminating the need for the `vpc_security_group_id`'s attribute inside the instance. Allowing full control over the security groups attached to each network interface specifically. \r\n\r\nPlease let me know if there are any other concerns with this issue, and I can try and address them in a future patch. :heart: "}}
{"actor":{"display_login":"grubernaut"}}