{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2815","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2815/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2815/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2815/events","html_url":"https://github.com/hashicorp/terraform/pull/2815","id":96545399,"number":2815,"title":"core: Add resource IDs to apply-errors + prevent error duplication","user":{"login":"radeksimko","id":287584,"avatar_url":"https://avatars.githubusercontent.com/u/287584?v=3","gravatar_id":"","url":"https://api.github.com/users/radeksimko","html_url":"https://github.com/radeksimko","followers_url":"https://api.github.com/users/radeksimko/followers","following_url":"https://api.github.com/users/radeksimko/following{/other_user}","gists_url":"https://api.github.com/users/radeksimko/gists{/gist_id}","starred_url":"https://api.github.com/users/radeksimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radeksimko/subscriptions","organizations_url":"https://api.github.com/users/radeksimko/orgs","repos_url":"https://api.github.com/users/radeksimko/repos","events_url":"https://api.github.com/users/radeksimko/events{/privacy}","received_events_url":"https://api.github.com/users/radeksimko/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/core","name":"core","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-22T11:34:13Z","updated_at":"2015-07-27T15:08:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/2815","html_url":"https://github.com/hashicorp/terraform/pull/2815","diff_url":"https://github.com/hashicorp/terraform/pull/2815.diff","patch_url":"https://github.com/hashicorp/terraform/pull/2815.patch"},"body":"This is a proposal for fixing #2801 and similar with a more systematic approach.\r\n\r\nCurrent state:\r\n```\r\naws_route53_record.www: Creating...\r\n  fqdn:               \"\" => \"<computed>\"\r\n  name:               \"\" => \"www.notexample.com\"\r\n  records.#:          \"\" => \"1\"\r\n  records.3619153832: \"\" => \"127.0.0.1\"\r\n  ttl:                \"\" => \"300\"\r\n  type:               \"\" => \"A\"\r\n  zone_id:            \"\" => \"WRONGID\"\r\naws_route53_record.www: Error: 1 error(s) occurred:\r\n\r\n* NoSuchHostedZone: No hosted zone found with ID: WRONGID\r\n\tstatus code: 404, request id: [d7febede-3063-11e5-9472-2971854b3f91]\r\nError applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* NoSuchHostedZone: No hosted zone found with ID: WRONGID\r\n\tstatus code: 404, request id: [d7febede-3063-11e5-9472-2971854b3f91]\r\n\r\nTerraform does not automatically rollback in the face of errors.\r\nInstead, your Terraform state file has been partially updated with\r\nany resources that successfully completed. Please address the error\r\nabove and apply again to incrementally change your infrastructure.\r\n```\r\n\r\nthis PR is changing it into the following (no duplicate errors and resource ID mentioned):\r\n\r\n```\r\naws_route53_record.www: Creating...\r\n  fqdn:               \"\" => \"<computed>\"\r\n  name:               \"\" => \"www.notexample.com\"\r\n  records.#:          \"\" => \"1\"\r\n  records.3619153832: \"\" => \"127.0.0.1\"\r\n  ttl:                \"\" => \"300\"\r\n  type:               \"\" => \"A\"\r\n  zone_id:            \"\" => \"WRONGID\"\r\nError applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* aws_route53_record.www: NoSuchHostedZone: No hosted zone found with ID: WRONGID\r\n\tstatus code: 404, request id: [1db1c357-3064-11e5-8c8a-916e2ed8af08]\r\n\r\nTerraform does not automatically rollback in the face of errors.\r\nInstead, your Terraform state file has been partially updated with\r\nany resources that successfully completed. Please address the error\r\nabove and apply again to incrementally change your infrastructure\r\n```\r\n\r\nHere's a simple way to trigger an error (and see the difference):\r\n```ruby\r\nprovider \"aws\" {\r\n    region = \"us-west-2\"\r\n}\r\n\r\nresource \"aws_route53_record\" \"www\" {\r\n   zone_id = \"WRONGID\"\r\n   name = \"www.notexample.com\"\r\n   type = \"A\"\r\n   ttl = \"300\"\r\n   records = [\"127.0.0.1\"]\r\n}\r\n```\r\n\r\n`git blame command/hook_ui.go` only brought up @mitchellh , so I think he would be the best candidate for reviewing.\r\n\r\nThe other option would be to keep the error printing in UiHook which has the advantage of more \"real-time\" feedback, but in that case we should:\r\n\r\n1. Print it in red (it is now bold white)\r\n2. Somehow filter these errors out in `eval_apply.go` so it's not duplicated.\r\n\r\nFYI @failshell @catsby "},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/125239902","html_url":"https://github.com/hashicorp/terraform/pull/2815#issuecomment-125239902","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2815","id":125239902,"user":{"login":"radeksimko","id":287584,"avatar_url":"https://avatars.githubusercontent.com/u/287584?v=3","gravatar_id":"","url":"https://api.github.com/users/radeksimko","html_url":"https://github.com/radeksimko","followers_url":"https://api.github.com/users/radeksimko/followers","following_url":"https://api.github.com/users/radeksimko/following{/other_user}","gists_url":"https://api.github.com/users/radeksimko/gists{/gist_id}","starred_url":"https://api.github.com/users/radeksimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radeksimko/subscriptions","organizations_url":"https://api.github.com/users/radeksimko/orgs","repos_url":"https://api.github.com/users/radeksimko/repos","events_url":"https://api.github.com/users/radeksimko/events{/privacy}","received_events_url":"https://api.github.com/users/radeksimko/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T15:08:16Z","updated_at":"2015-07-27T15:08:16Z","body":"@phinze Agreed, it can be revisited later."}}