{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/7967","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/7967/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/7967/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/7967/events","html_url":"https://github.com/hashicorp/terraform/issues/7967","id":169293725,"number":7967,"title":"Terraform doesn't produce error if parsing of s3 bucket policy json failed","user":{"login":"murat1985","id":1124779,"avatar_url":"https://avatars.githubusercontent.com/u/1124779?v=3","gravatar_id":"","url":"https://api.github.com/users/murat1985","html_url":"https://github.com/murat1985","followers_url":"https://api.github.com/users/murat1985/followers","following_url":"https://api.github.com/users/murat1985/following{/other_user}","gists_url":"https://api.github.com/users/murat1985/gists{/gist_id}","starred_url":"https://api.github.com/users/murat1985/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murat1985/subscriptions","organizations_url":"https://api.github.com/users/murat1985/orgs","repos_url":"https://api.github.com/users/murat1985/repos","events_url":"https://api.github.com/users/murat1985/events{/privacy}","received_events_url":"https://api.github.com/users/murat1985/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":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-04T05:25:54Z","updated_at":"2016-08-06T21:38:37Z","closed_at":null,"body":"Spotted minor bug in behaviour. Terraform produces green success output even s3 bucket policy json parsing is failed:\r\n```\r\nmake plan\r\n...\r\n+ aws_s3_bucket.bucket-name\r\n    acceleration_status:      \"<computed>\"\r\n    acl:                      \"private\"\r\n    arn:                      \"<computed>\"\r\n    bucket:                   \"bucket-name\"\r\n    force_destroy:            \"false\"\r\n    hosted_zone_id:           \"<computed>\"\r\n    policy:                   \"Error parsing JSON: invalid character '\\\"' after object key:value pair\"\r\n    region:                   \"<computed>\"\r\n    website.#:                \"1\"\r\n    website.0.index_document: \"index.html\"\r\n    website_domain:           \"<computed>\"\r\n    website_endpoint:         \"<computed>\"\r\n```\r\n\r\n### Terraform Version\r\n```\r\n >> terraform -v\r\nTerraform v0.7.0\r\n```\r\n### Affected Resource(s)\r\n```\r\naws_s3_bucket\r\n```\r\n\r\n### Terraform Configuration Files\r\n\r\nTo reproduce make json output invalid, e.g. remove coma before \"Condition\" key.\r\n\r\n```\r\n  policy = <<EOF\r\n{\r\n  \"Version\": \"2008-10-17\",\r\n  \"Id\": \"Policy1234567\",\r\n  \"Statement\": [\r\n    {\r\n      \"Sid\": \"AllowGetObject\",\r\n      \"Effect\": \"Allow\",\r\n      \"Principal\": \"*\",\r\n      \"Action\": \"s3:GetObject\",\r\n      \"Resource\": \"arn:aws:s3:::bucket_name\"\r\n      \"Condition\": {\r\n        \"IpAdress\": {\r\n          \"aws:SourceIp\": [ \"${var.myvar}\" ]\r\n        }\r\n      }\r\n    }\r\n  ]\r\n}\r\nEOF\r\n```\r\n\r\n### Expected Behavior\r\nFail terraform plan on json error\r\n```\r\n\"Error parsing JSON: invalid character '\\\"' after object key:value pair\"\r\n```\r\n\r\n### Actual Behavior\r\nIt doesn't fail and produces green output\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/238050152","html_url":"https://github.com/hashicorp/terraform/issues/7967#issuecomment-238050152","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/7967","id":238050152,"user":{"login":"kwilczynski","id":250723,"avatar_url":"https://avatars.githubusercontent.com/u/250723?v=3","gravatar_id":"","url":"https://api.github.com/users/kwilczynski","html_url":"https://github.com/kwilczynski","followers_url":"https://api.github.com/users/kwilczynski/followers","following_url":"https://api.github.com/users/kwilczynski/following{/other_user}","gists_url":"https://api.github.com/users/kwilczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/kwilczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwilczynski/subscriptions","organizations_url":"https://api.github.com/users/kwilczynski/orgs","repos_url":"https://api.github.com/users/kwilczynski/repos","events_url":"https://api.github.com/users/kwilczynski/events{/privacy}","received_events_url":"https://api.github.com/users/kwilczynski/received_events","type":"User","site_admin":false},"created_at":"2016-08-06T21:38:37Z","updated_at":"2016-08-06T21:38:37Z","body":"@jen20 I am having a look at this:\r\n\r\nhttps://github.com/kwilczynski/terraform/commit/278932a5403218d25cddd1761fa34b126b551c55\r\n\r\nThere is more work to do be done as `normalizeJson` is used all over the place.\r\n\r\n"}}
{"actor":{"display_login":"kwilczynski"}}