{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2248","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2248/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2248/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2248/events","html_url":"https://github.com/hashicorp/terraform/issues/2248","id":85618182,"number":2248,"title":"bug: (severe) multi-line comment block not parsed correctly","user":{"login":"neurogenesis","id":613023,"avatar_url":"https://avatars.githubusercontent.com/u/613023?v=3","gravatar_id":"","url":"https://api.github.com/users/neurogenesis","html_url":"https://github.com/neurogenesis","followers_url":"https://api.github.com/users/neurogenesis/followers","following_url":"https://api.github.com/users/neurogenesis/following{/other_user}","gists_url":"https://api.github.com/users/neurogenesis/gists{/gist_id}","starred_url":"https://api.github.com/users/neurogenesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neurogenesis/subscriptions","organizations_url":"https://api.github.com/users/neurogenesis/orgs","repos_url":"https://api.github.com/users/neurogenesis/repos","events_url":"https://api.github.com/users/neurogenesis/events{/privacy}","received_events_url":"https://api.github.com/users/neurogenesis/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":4,"created_at":"2015-06-05T19:45:44Z","updated_at":"2015-06-24T04:01:37Z","closed_at":null,"body":"With terraform version 0.5.3, we just ran into an issue where a multi-line block comment with /* ... */ was parsed incorrectly, resulting in the planned removal of a number of AWS resources (everything following that block).\r\n\r\nThe following was near the top of the configuration file:\r\n\r\n```\r\n...\r\n## managed policies not yet supported\r\n/*\r\nresource \"aws_iam_policy\" \"ec2-bootstrap-cloudinit\" {\r\n  name = \"ec2-bootstrap-cloudinit\"\r\n  path = \"/\"\r\n  description = \"Policy for system provisioning via cloud-init (access to bootstrap S3 bucket)\"\r\n  policy = <<EOF\r\n{\r\n  \"Version\": \"2012-10-17\",\r\n  \"Statement\": [\r\n    {\r\n      \"Effect\": \"Allow\",\r\n      \"Action\": [\r\n        \"s3:GetObject\"\r\n      ],\r\n      \"Resource\": [\r\n        \"arn:aws:s3:::xxx-bootstrap/*\"\r\n      ]\r\n    }\r\n  ]\r\n}\r\nEOF\r\n}\r\n*/\r\n...\r\n```\r\n\r\nOur best guess is that the parser may have incorrectly processed the \"<<EOF\" directive, commenting out the rest of the file. What's odd is that this didn't seem to generate an invalid configuration file syntax.\r\n\r\nCommenting each line with \"#\" instead avoids the problem.\r\n\r\nWe also noticed that EIPs are released when destroyed (instead of disassociated and kept in the local pool). This could be problematic for 3rd-party white-listed public IPs, since there's no way to re-associate a public IP once it's been released back to AWS. If it were disassociated in stead of released, customers would have the option of re-associating the same IP in the event of an accidental resource removal. I'll file a separate feature request for that.\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/114721719","html_url":"https://github.com/hashicorp/terraform/issues/2248#issuecomment-114721719","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2248","id":114721719,"user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T04:01:37Z","updated_at":"2015-06-24T04:01:37Z","body":"Okay, I've confirmed that C allows (but warns) when a block comment starts within a comment, even within a string:\r\n\r\n```\r\nwhat → gcc main.c \r\nmain.c:3:21: warning: '/*' within block comment [-Wcomment]\r\n    char *foo = \"bar/*\";\r\n                    ^\r\n1 warning generated.\r\n```\r\n\r\nAnd if you end a comment in a string, it actually ends:\r\n\r\n```\r\nwhat → gcc main.c\r\nmain.c:3:23: warning: missing terminating '\"' character [-Winvalid-pp-token]\r\n    char *foo = \"bar*/\";\r\n                      ^\r\nmain.c:3:23: error: expected expression\r\n1 warning and 1 error generated.\r\n```\r\n\r\nWe'll copy this behavior upstream."}}