{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3837","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3837/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3837/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3837/events","html_url":"https://github.com/hashicorp/terraform/issues/3837","id":116015676,"number":3837,"title":"AWS IAM certificates get deleted on rerun even though tf files were not changed","user":{"login":"avinci","id":1302035,"avatar_url":"https://avatars.githubusercontent.com/u/1302035?v=3","gravatar_id":"","url":"https://api.github.com/users/avinci","html_url":"https://github.com/avinci","followers_url":"https://api.github.com/users/avinci/followers","following_url":"https://api.github.com/users/avinci/following{/other_user}","gists_url":"https://api.github.com/users/avinci/gists{/gist_id}","starred_url":"https://api.github.com/users/avinci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avinci/subscriptions","organizations_url":"https://api.github.com/users/avinci/orgs","repos_url":"https://api.github.com/users/avinci/repos","events_url":"https://api.github.com/users/avinci/events{/privacy}","received_events_url":"https://api.github.com/users/avinci/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"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/waiting-response","name":"waiting-response","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-10T03:04:45Z","updated_at":"2015-11-14T20:05:40Z","closed_at":null,"body":"I have 2 certs for SSL pointing to a 2 load balancers on AWS. Upon the first run of the terraform apply, it works fine. Now if I rerun apply again and not changing any part of the tf files, it will try to delete the IAM certs and this will fail as LBs are using it. Here is the log with TF_LOG enabled\r\n\r\nCert is present in the state file.\r\n\r\n```\r\n015/11/09 18:48:34 [DEBUG] vertex aws_iam_server_certificate.apiBetaCert, got dep: aws_iam_server_certificate.apiBetaCert (destroy)\r\n2015/11/09 18:48:34 [DEBUG] vertex aws_elb.betaAPILb, got dep: aws_iam_server_certificate.apiBetaCert\r\n2015/11/09 18:48:34 [DEBUG] vertex aws_elb.betaAPILb, got dep: var.amis\r\n2015/11/09 18:48:34 [DEBUG] vertex provider.aws (close), got dep: aws_elb.betaAPILb\r\n2015/11/09 18:48:34 [DEBUG] root: eval: *terraform.EvalWriteState\r\n2015/11/09 18:48:34 [DEBUG] root: eval: *terraform.EvalApplyPost\r\n2015/11/09 18:48:34 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:\r\n\r\n* aws_iam_server_certificate.wwwBetaCert: [WARN] Error deleting server certificate: DeleteConflict: Certificate: ASCAIS4G4XMALDFK6DDAY is currently in use by arn:aws:elasticloadbalancing:us-east-1:412520076220:loadbalancer/betaWWWLb. Please remove it first before deleting it from IAM.\r\n2015/11/09 18:48:34 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:\r\n``"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/156743066","html_url":"https://github.com/hashicorp/terraform/issues/3837#issuecomment-156743066","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3837","id":156743066,"user":{"login":"avinci","id":1302035,"avatar_url":"https://avatars.githubusercontent.com/u/1302035?v=3","gravatar_id":"","url":"https://api.github.com/users/avinci","html_url":"https://github.com/avinci","followers_url":"https://api.github.com/users/avinci/followers","following_url":"https://api.github.com/users/avinci/following{/other_user}","gists_url":"https://api.github.com/users/avinci/gists{/gist_id}","starred_url":"https://api.github.com/users/avinci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avinci/subscriptions","organizations_url":"https://api.github.com/users/avinci/orgs","repos_url":"https://api.github.com/users/avinci/repos","events_url":"https://api.github.com/users/avinci/events{/privacy}","received_events_url":"https://api.github.com/users/avinci/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T20:05:40Z","updated_at":"2015-11-14T20:05:40Z","body":"I think the main issue is the fact that the diff code is not working as expected between whats on AWS and whats in the tfstate."}}