{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3341","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3341/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3341/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3341/events","html_url":"https://github.com/hashicorp/terraform/issues/3341","id":108671894,"number":3341,"title":"Terraform apply fails when renaming aws_security_group","user":{"login":"paul-gitseed","id":14317393,"avatar_url":"https://avatars.githubusercontent.com/u/14317393?v=3","gravatar_id":"","url":"https://api.github.com/users/paul-gitseed","html_url":"https://github.com/paul-gitseed","followers_url":"https://api.github.com/users/paul-gitseed/followers","following_url":"https://api.github.com/users/paul-gitseed/following{/other_user}","gists_url":"https://api.github.com/users/paul-gitseed/gists{/gist_id}","starred_url":"https://api.github.com/users/paul-gitseed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paul-gitseed/subscriptions","organizations_url":"https://api.github.com/users/paul-gitseed/orgs","repos_url":"https://api.github.com/users/paul-gitseed/repos","events_url":"https://api.github.com/users/paul-gitseed/events{/privacy}","received_events_url":"https://api.github.com/users/paul-gitseed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-28T14:40:58Z","updated_at":"2015-09-30T12:05:04Z","closed_at":null,"body":"Issue #2117 was closed as unreproducible. I'm able to reproduce this bug and I run into it extremely frequently in 0.6.3.\r\n\r\nTo reproduce, clone this repo:\r\nhttps://github.com/paul-gitseed/terraformbug\r\n\r\nRun: reproduce.bash\r\n\r\nOutput:\r\n\r\n```\r\nadmin@ip-172-31-18-149:~/terraformbug$ ./reproduce.bash\r\naws_security_group.onefish: Creating...\r\n  description:                        \"\" => \"This reproduces a bug in terraform.\"\r\n  egress.#:                           \"\" => \"1\"\r\n  egress.482069346.cidr_blocks.#:     \"\" => \"1\"\r\n  egress.482069346.cidr_blocks.0:     \"\" => \"0.0.0.0/0\"\r\n  egress.482069346.from_port:         \"\" => \"0\"\r\n  egress.482069346.protocol:          \"\" => \"-1\"\r\n  egress.482069346.security_groups.#: \"\" => \"0\"\r\n  egress.482069346.self:              \"\" => \"0\"\r\n  egress.482069346.to_port:           \"\" => \"0\"\r\n  ingress.#:                          \"\" => \"<computed>\"\r\n  name:                               \"\" => \"redfish\"\r\n  owner_id:                           \"\" => \"<computed>\"\r\n  vpc_id:                             \"\" => \"<computed>\"\r\naws_security_group.onefish: Creation complete\r\naws_instance.twofish: Creating...\r\n  ami:                                       \"\" => \"ami-818eb7b1\"\r\n  availability_zone:                         \"\" => \"<computed>\"\r\n  ebs_block_device.#:                        \"\" => \"<computed>\"\r\n  ephemeral_block_device.#:                  \"\" => \"<computed>\"\r\n  instance_type:                             \"\" => \"t2.micro\"\r\n  key_name:                                  \"\" => \"<computed>\"\r\n  placement_group:                           \"\" => \"<computed>\"\r\n  private_dns:                               \"\" => \"<computed>\"\r\n  private_ip:                                \"\" => \"<computed>\"\r\n  public_dns:                                \"\" => \"<computed>\"\r\n  public_ip:                                 \"\" => \"<computed>\"\r\n  root_block_device.#:                       \"\" => \"1\"\r\n  root_block_device.0.delete_on_termination: \"\" => \"1\"\r\n  root_block_device.0.iops:                  \"\" => \"<computed>\"\r\n  root_block_device.0.volume_size:           \"\" => \"<computed>\"\r\n  root_block_device.0.volume_type:           \"\" => \"gp2\"\r\n  security_groups.#:                         \"\" => \"<computed>\"\r\n  source_dest_check:                         \"\" => \"1\"\r\n  subnet_id:                                 \"\" => \"<computed>\"\r\n  tenancy:                                   \"\" => \"<computed>\"\r\n  vpc_security_group_ids.#:                  \"\" => \"1\"\r\n  vpc_security_group_ids.1611644906:         \"\" => \"sg-538c1c37\"\r\naws_instance.twofish: Creation complete\r\n\r\nApply complete! Resources: 2 added, 0 changed, 0 destroyed.\r\n\r\nThe state of your infrastructure has been saved to the path\r\nbelow. This state is required to modify and destroy your\r\ninfrastructure, so keep it safe. To inspect the complete state\r\nuse the `terraform show` command.\r\n\r\nState path: ../terraform.tfstate\r\naws_security_group.onefish: Refreshing state... (ID: sg-538c1c37)\r\naws_instance.twofish: Refreshing state... (ID: i-fb4e5a3e)\r\naws_security_group.onefish: Destroying...\r\nError applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* aws_security_group.onefish: DependencyViolation: resource sg-538c1c37 has a dependent object\r\n        status code: 400, request id: []\r\n\r\nTerraform does not automatically rollback in the face of errors.\r\nInstead, your Terraform state file has been partially updated with\r\nany resources that successfully completed. Please address the error\r\nabove and apply again to incrementally change your infrastructure.\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/144375525","html_url":"https://github.com/hashicorp/terraform/issues/3341#issuecomment-144375525","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3341","id":144375525,"user":{"login":"paulcdejean","id":1987879,"avatar_url":"https://avatars.githubusercontent.com/u/1987879?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcdejean","html_url":"https://github.com/paulcdejean","followers_url":"https://api.github.com/users/paulcdejean/followers","following_url":"https://api.github.com/users/paulcdejean/following{/other_user}","gists_url":"https://api.github.com/users/paulcdejean/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcdejean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcdejean/subscriptions","organizations_url":"https://api.github.com/users/paulcdejean/orgs","repos_url":"https://api.github.com/users/paulcdejean/repos","events_url":"https://api.github.com/users/paulcdejean/events{/privacy}","received_events_url":"https://api.github.com/users/paulcdejean/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T12:05:04Z","updated_at":"2015-09-30T12:05:04Z","body":"Well if your under ec2 classic you'd have no choice. Should classic be\nsupported though? I think it should not be personally.\nOn Sep 30, 2015 7:02 AM, \"Luke Hoersten\" <notifications@github.com> wrote:\n\n> By \"instance\" I mean EC2 instance. Destroying and recreating an EC2\n> instance to change a SG name would not be acceptable for my case.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/hashicorp/terraform/issues/3341#issuecomment-144375166>\n> .\n>\n"}}