{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/2584","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/2584/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/2584/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/2584/events","html_url":"https://github.com/hashicorp/terraform/issues/2584","id":92336861,"number":2584,"title":"Some aws_security_group_rules are not added to tfstate file.","user":{"login":"gtmtech","id":2953949,"avatar_url":"https://avatars.githubusercontent.com/u/2953949?v=3","gravatar_id":"","url":"https://api.github.com/users/gtmtech","html_url":"https://github.com/gtmtech","followers_url":"https://api.github.com/users/gtmtech/followers","following_url":"https://api.github.com/users/gtmtech/following{/other_user}","gists_url":"https://api.github.com/users/gtmtech/gists{/gist_id}","starred_url":"https://api.github.com/users/gtmtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtmtech/subscriptions","organizations_url":"https://api.github.com/users/gtmtech/orgs","repos_url":"https://api.github.com/users/gtmtech/repos","events_url":"https://api.github.com/users/gtmtech/events{/privacy}","received_events_url":"https://api.github.com/users/gtmtech/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":{"login":"catsby","id":61721,"avatar_url":"https://avatars.githubusercontent.com/u/61721?v=3","gravatar_id":"","url":"https://api.github.com/users/catsby","html_url":"https://github.com/catsby","followers_url":"https://api.github.com/users/catsby/followers","following_url":"https://api.github.com/users/catsby/following{/other_user}","gists_url":"https://api.github.com/users/catsby/gists{/gist_id}","starred_url":"https://api.github.com/users/catsby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catsby/subscriptions","organizations_url":"https://api.github.com/users/catsby/orgs","repos_url":"https://api.github.com/users/catsby/repos","events_url":"https://api.github.com/users/catsby/events{/privacy}","received_events_url":"https://api.github.com/users/catsby/received_events","type":"User","site_admin":false},"milestone":null,"comments":29,"created_at":"2015-07-01T10:07:46Z","updated_at":"2015-08-20T15:03:32Z","closed_at":null,"body":"We thought in terraform 0.6.0 #2366 might fix this issue, but we have tested on 0.5.3, and 0.6.0 and it is still broken.\r\n\r\nWe have a fairly large configuration full of aws_security_group_rules and sometimes multiple security_groups applied to aws_instances. We like having individual rules, rather than lots of rules in an aws_security_group, because they can be labelled, and there were previous bugs with aws_security_group on changing some of the rules, causing us to go down the aws_security_group_rules route. (We like managing the rules independently of the security group)\r\n\r\nThe problem is, on a fresh terraform apply, terraform reports that all aws_security_group_rules have been created, but some of them (a random selection each time) are not added to the tfstate file. This means that a further terraform plan yields further rules to be created, but because they do exist in Amazon, a further terraform apply does not work, as they come back with \"duplicate rule\". \r\n\r\nI ran the whole thing in TF_LOG=debug mode, so have captured everything, and have tried to show the relevant bits here (as I dont want to share the entire config of what I'm doing), but the key facts are that each time a fresh terraform apply (from nothing) is done, a random set of rules fails to make it into the tfstate file.\r\n\r\nI will shortly update this with the relevant snippets of logs/code etc.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/133042494","html_url":"https://github.com/hashicorp/terraform/issues/2584#issuecomment-133042494","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/2584","id":133042494,"user":{"login":"gtmtech","id":2953949,"avatar_url":"https://avatars.githubusercontent.com/u/2953949?v=3","gravatar_id":"","url":"https://api.github.com/users/gtmtech","html_url":"https://github.com/gtmtech","followers_url":"https://api.github.com/users/gtmtech/followers","following_url":"https://api.github.com/users/gtmtech/following{/other_user}","gists_url":"https://api.github.com/users/gtmtech/gists{/gist_id}","starred_url":"https://api.github.com/users/gtmtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtmtech/subscriptions","organizations_url":"https://api.github.com/users/gtmtech/orgs","repos_url":"https://api.github.com/users/gtmtech/repos","events_url":"https://api.github.com/users/gtmtech/events{/privacy}","received_events_url":"https://api.github.com/users/gtmtech/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T15:03:32Z","updated_at":"2015-08-20T15:03:32Z","body":"Sorry, been sending github mails to junk and didnt see the progress on this - do you still want help testing ? "}}