{"action":"opened","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/8368","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/8368/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/8368/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/8368/events","html_url":"https://github.com/hashicorp/terraform/issues/8368","id":172387757,"number":8368,"title":"aws: if \"aws_iam_policy_attachment\" has a blank name, state is empty","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-22T07:43:59Z","updated_at":"2016-08-22T07:43:59Z","closed_at":null,"body":"Following the format below but its clear from looking at the source that we need to do a validation func that the name is non-empty since we use it as the ID in the state. If it is blank then helper/schema doesn't store anything for it!\r\n\r\n### Terraform Version\r\n\r\n0.7.1\r\n\r\n### Affected Resource(s)\r\n\r\n- aws_iam_policy_attachment\r\n\r\n### Terraform Configuration Files\r\n\r\n```hcl\r\nresource \"aws_iam_policy_attachment\" \"attach_admin\" {\r\n    name = \"\"\r\n\r\n    groups = [\r\n      \"asdf\"\r\n    ]\r\n\r\n    policy_arn = \"arn:aws:iam::aws:policy/AdministratorAccess\"\r\n}\r\n```\r\n\r\n### Expected Behavior\r\n\r\nIt creates the IAM policy attachment and stores it in the state.\r\n\r\n### Actual Behavior\r\n\r\nIt **does** crate the IAM policy attachment **but** it doesn't store it in the state, resulting in `terraform apply` constantly creating the attachment.\r\n\r\n### Steps to Reproduce\r\n\r\n1. `terraform apply`\r\n1. `terraform apply` again\r\n"}}
{"actor":{"display_login":"mitchellh"}}