{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/9977","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/9977/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/9977/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/9977/events","html_url":"https://github.com/hashicorp/terraform/issues/9977","id":188124128,"number":9977,"title":"data.aws_iam_policy_document problems in 0.7.9","user":{"login":"cread","id":100992,"avatar_url":"https://avatars.githubusercontent.com/u/100992?v=3","gravatar_id":"","url":"https://api.github.com/users/cread","html_url":"https://github.com/cread","followers_url":"https://api.github.com/users/cread/followers","following_url":"https://api.github.com/users/cread/following{/other_user}","gists_url":"https://api.github.com/users/cread/gists{/gist_id}","starred_url":"https://api.github.com/users/cread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cread/subscriptions","organizations_url":"https://api.github.com/users/cread/orgs","repos_url":"https://api.github.com/users/cread/repos","events_url":"https://api.github.com/users/cread/events{/privacy}","received_events_url":"https://api.github.com/users/cread/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-08T22:42:00Z","updated_at":"2016-11-09T20:08:12Z","closed_at":"2016-11-09T01:01:55Z","body":"The following config works perfectly in `0.7.7` but has problems in `0.7.9`\r\n\r\n```hcl\r\nvariable \"bucket_name\" {\r\n  default = \"test.log\"\r\n}\r\n\r\nvariable \"acl\" {\r\n  default = \"log-delivery-write\"\r\n}\r\n\r\nresource \"aws_s3_bucket\" \"bucket\" {\r\n  bucket = \"${var.bucket_name}\"\r\n  acl    = \"${var.acl}\"\r\n}\r\n\r\ndata \"aws_iam_policy_document\" \"policy\" {\r\n  statement {\r\n    sid = \"DenyDeletingObjects\"\r\n    effect = \"Deny\"\r\n    actions = [\r\n      \"s3:DeleteObject\",\r\n      \"s3:DeleteObjectVersion\"\r\n    ]\r\n    principals {\r\n      type = \"AWS\"\r\n      identifiers = [\"*\"]\r\n    }\r\n    resources = [\r\n      \"${aws_s3_bucket.bucket.arn}/*\"\r\n    ]\r\n  }\r\n\r\n  statement {\r\n    sid = \"DenyDeletingBucket\"\r\n    effect = \"Deny\"\r\n    actions = [\r\n      \"s3:DeleteBucket\"\r\n    ]\r\n    principals {\r\n      type = \"AWS\"\r\n      identifiers = [\"*\"]\r\n    }\r\n    resources = [\r\n      \"${aws_s3_bucket.bucket.arn}\"\r\n    ]\r\n  }\r\n}\r\n\r\nresource \"aws_s3_bucket_policy\" \"bucket\"{\r\n  bucket = \"${aws_s3_bucket.bucket.bucket}\"\r\n  policy = \"${data.aws_iam_policy_document.policy.json}\"\r\n}\r\n```\r\n\r\nWith no `terraform.tfstate` file, the `terraform plan` command gives the following error:\r\n\r\n```\r\n1 error(s) occurred:\r\n\r\n* plan operation: ReadDataDiff \"data.aws_iam_policy_document.policy\" had unequal configs (real, then shadow):\r\n\r\n&terraform.ResourceConfig{ComputedKeys:[]string{\"statement.resources\", \"statement.resources\"}, Raw:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}/*\"}, \"sid\":\"DenyDeletingObjects\", \"effect\":\"Deny\"}, map[string]interface {}{\"sid\":\"DenyDeletingBucket\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteBucket\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}\"}}}}, Config:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"sid\":\"DenyDeletingObjects\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}}, map[string]interface {}{\"principals\":[]map[string]interface {}{map[string]interface {}{\"identifiers\":[]interface {}{\"*\"}, \"type\":\"AWS\"}}, \"sid\":\"DenyDeletingBucket\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteBucket\"}}}}, raw:(*config.RawConfig)(0xc4204f5a40)}\r\n\r\n&terraform.ResourceConfig{ComputedKeys:[]string{\"statement.1.resources\", \"statement.resources\"}, Raw:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}/*\"}, \"sid\":\"DenyDeletingObjects\", \"effect\":\"Deny\"}, map[string]interface {}{\"sid\":\"DenyDeletingBucket\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteBucket\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}\"}}}}, Config:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"sid\":\"DenyDeletingObjects\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}}, map[string]interface {}{\"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteBucket\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"sid\":\"DenyDeletingBucket\"}}}, raw:(*config.RawConfig)(0xc42014cf00)}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/259512935","html_url":"https://github.com/hashicorp/terraform/issues/9977#issuecomment-259512935","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/9977","id":259512935,"user":{"login":"cread","id":100992,"avatar_url":"https://avatars.githubusercontent.com/u/100992?v=3","gravatar_id":"","url":"https://api.github.com/users/cread","html_url":"https://github.com/cread","followers_url":"https://api.github.com/users/cread/followers","following_url":"https://api.github.com/users/cread/following{/other_user}","gists_url":"https://api.github.com/users/cread/gists{/gist_id}","starred_url":"https://api.github.com/users/cread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cread/subscriptions","organizations_url":"https://api.github.com/users/cread/orgs","repos_url":"https://api.github.com/users/cread/repos","events_url":"https://api.github.com/users/cread/events{/privacy}","received_events_url":"https://api.github.com/users/cread/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T20:08:12Z","updated_at":"2016-11-09T20:08:12Z","body":"Sadly this is not the case.\r\n\r\nI've just tried again with `v0.7.10` and get the following error:\r\n\r\n```\r\n* plan operation: ReadDataDiff \"data.aws_iam_policy_document.policy\" had unequal configs (real, then shadow):\r\n\r\n&terraform.ResourceConfig{ComputedKeys:[]string{\"statement.resources\", \"statement.resources\"}, Raw:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}/*\"}, \"sid\":\"DenyDeletingObjects\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}}, map[string]interface {}{\"sid\":\"DenyDeletingBucket\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteBucket\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}\"}}}}, Config:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"identifiers\":[]interface {}{\"*\"}, \"type\":\"AWS\"}}, \"sid\":\"DenyDeletingObjects\"}, map[string]interface {}{\"actions\":[]interface {}{\"s3:DeleteBucket\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"sid\":\"DenyDeletingBucket\", \"effect\":\"Deny\"}}}, raw:(*config.RawConfig)(0xc420385ce0)}\r\n\r\n&terraform.ResourceConfig{ComputedKeys:[]string{\"statement.1.resources\", \"statement.resources\"}, Raw:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}/*\"}, \"sid\":\"DenyDeletingObjects\", \"effect\":\"Deny\"}, map[string]interface {}{\"sid\":\"DenyDeletingBucket\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteBucket\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"resources\":[]interface {}{\"${aws_s3_bucket.bucket.arn}\"}}}}, Config:map[string]interface {}{\"statement\":[]map[string]interface {}{map[string]interface {}{\"actions\":[]interface {}{\"s3:DeleteObject\", \"s3:DeleteObjectVersion\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}, \"sid\":\"DenyDeletingObjects\", \"effect\":\"Deny\"}, map[string]interface {}{\"sid\":\"DenyDeletingBucket\", \"effect\":\"Deny\", \"actions\":[]interface {}{\"s3:DeleteBucket\"}, \"principals\":[]map[string]interface {}{map[string]interface {}{\"type\":\"AWS\", \"identifiers\":[]interface {}{\"*\"}}}}}}, raw:(*config.RawConfig)(0xc4200f6a80)}\r\n```"}}
{"actor":{"display_login":"cread"}}